F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

View Compilation Error

0_0_39600784_3902.cpp: In function 'int main()':
0_0_39600784_3902.cpp:5:414: error: 'put' was not declared in this scope; did you mean 'putw'?
    5 | const int N=1e5;const int mod=1e9+7;ll sum[N],mul[N];ll fast_pow(ll x,ll y,int m){ll res=1;while (y){if (y&1) res*=x,res%=m;x=(x*x)%m;y>>=1;}return res;}long long mod_inverse(long long a,long long mod){return fast_pow(a,mod-2,mod);}void init(){sum[1]=0;mul[1]=1;for (int i=2;i<=N;i++){sum[i]=sum[i-1]+i;mul[i]=(i*mul[i-1])%mod;}}int main(){init();int T;scanf("%d",&T);while (T--){int x;scanf(" % d",&x);if (x==1){put("1");continue;}int k=upper_bound(sum+1,sum+1+N,x)-sum-1;int m=x-sum[k];ll ans;if (k==m) ans=mul[k]*mod_inverse(2,mod)%mod*(k+2)%mod;else ans=mul[k+1]*mod_inverse(k-m+1,mod)%mod%mod;printf("%lld\n",ans);}return 0;}
      |                                                                                                                                                                                                                                                                                                                                                                                                                              ^~~
      |                                                                                                                                                                                                                                                                                                                                                                                                                              putw


Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-11-29 22:01:13, Gzip enabled