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_16612116_217.c: In function 'main':
0_0_16612116_217.c:2:210: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
 typedef long long LL;const LL m=1e9+7;int main(){LL n,k,T;scanf("%lld",&T);while(T--){scanf("%lld %lld",&n,&k);LL a = (2*n-k*(k-1))/(2*k);LL s=(a+a+k-1)*k/2;LL c=n-s;LL ans=1;if(a<=0){printf("-1\n");continue;}for(LL i = a+k-1;i>=a;i--){if(c){ans=(ans*(i+1))%m;c--;}else ans=(ans*i)%m;}printf("%lld\n",ans);}}
                                                                                                                                                                                                                  ^
0_0_16612116_217.c:2:210: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code


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-12-02 12:51:00, Gzip enabled