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_39600765_14077.cpp:5:24: error: 'sum' does not name a type
    5 | const int mod=1e9+7;ll sum[N],mul[N];ll fast_pow(ll x,ll y,int m){x^y mod 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){puts("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);}
      |                        ^~~
0_0_39600765_14077.cpp:4:32: error: redefinition of 'const long long int N'
    4 | #define ll long long const int N=1e5;
      |                                ^
0_0_39600765_14077.cpp:5:38: note: in expansion of macro 'll'
    5 | const int mod=1e9+7;ll sum[N],mul[N];ll fast_pow(ll x,ll y,int m){x^y mod 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){puts("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);}
      |                                      ^~
0_0_39600765_14077.cpp:4:32: note: 'const long long int N' previously defined here
    4 | #define ll long long const int N=1e5;
      |                                ^
0_0_39600765_14077.cpp:5:21: note: in expansion of macro 'll'
    5 | const int mod=1e9+7;ll sum[N],mul[N];ll fast_pow(ll x,ll y,int m){x^y mod 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){puts("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);}
      |                     ^~
0_0_39600765_14077.cpp:4:37: error: expected ')' before ';' token
    4 | #define ll long long const int N=1e5;
      |                                     ^
0_0_39600765_14077.cpp:5:50: note: in expansion of macro 'll'
    5 | const int mod=1e9+7;ll sum[N],mul[N];ll fast_pow(ll x,ll y,int m){x^y mod 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){puts("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);}
      |                                                  ^~
0_0_39600765_14077.cpp:5:49: note: to match this '('
    5 | const int mod=1e9+7;ll sum[N],mul[N];ll fast_pow(ll x,ll y,int m){x^y mod 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){puts("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);}
      |                                                 ^
0_0_39600765_14077.cpp:4:37: error: expected constructor, destructor, or type conversion before ';' token
    4 | #define ll long long const int N=1e5;
      |                                     ^
0_0_39600765_14077.cpp:5:50: note: in expansion of macro 'll'
    5 | const int mod=1e9+7;ll sum[N],mul[N];ll fast_pow(ll x,ll y,int m){x^y mod 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){puts("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);}
      |                                                  ^~
0_0_39600765_14077.cpp:5:53: error: 'x' does not name a type
    5 | const int mod=1e9+7;ll sum[N],mul[N];ll fast_pow(ll x,ll y,int m){x^y mod 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){puts("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);}
      |                                                     ^
0_0_39600765_14077.cpp:5:58: error: 'y' does not name a type
    5 | const int mod=1e9+7;ll sum[N],mul[N];ll fast_pow(ll x,ll y,int m){x^y mod 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){puts("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);}
      |                                                          ^
0_0_39600765_14077.cpp: In function 'long long int mod_inverse(long long int, long long int)':
0_0_39600765_14077.cpp:5:204: error: 'fast_pow' was not declared in this scope
    5 | const int mod=1e9+7;ll sum[N],mul[N];ll fast_pow(ll x,ll y,int m){x^y mod 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){puts("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);}
      |                                                                                                                                                                                                            ^~~~~~~~
0_0_39600765_14077.cpp: In function 'void init()':
0_0_39600765_14077.cpp:5:239: error: 'sum' was not declared in this scope
    5 | const int mod=1e9+7;ll sum[N],mul[N];ll fast_pow(ll x,ll y,int m){x^y mod 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){puts("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);}
      |                                                                                                                                                                                                                                               ^~~
0_0_39600765_14077.cpp:5:248: error: 'mul' was not declared in this scope
    5 | const int mod=1e9+7;ll sum[N],mul[N];ll fast_pow(ll x,ll y,int m){x^y mod 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){puts("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);}
      |                                                                                                                                                                                                                                                        ^~~
0_0_39600765_14077.cpp: In function 'int main()':
0_0_39600765_14077.cpp:5:446: error: 'sum' was not declared in this scope
    5 | const int mod=1e9+7;ll sum[N],mul[N];ll fast_pow(ll x,ll y,int m){x^y mod 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",&


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-26 09:56:21, Gzip enabled