結果
問題 | No.2017 Mod7 Parade |
ユーザー |
![]() |
提出日時 | 2022-07-22 23:15:56 |
言語 | C90 (gcc 12.3.0) |
結果 |
CE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 776 bytes |
コンパイル時間 | 1,451 ms |
コンパイル使用メモリ | 25,856 KB |
最終ジャッジ日時 | 2025-04-28 02:39:00 |
合計ジャッジ時間 | 2,921 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
コンパイルメッセージ
main.c: In function 'main': main.c:4:18: error: 'for' loop initial declarations are only allowed in C99 or C11 mode 4 | #define rep(v,e) for(long v=0;v<e;++v) | ^~~ main.c:24:17: note: in expansion of macro 'rep' 24 | rep(i,7)e[i]=a[i]; | ^~~ main.c:4:18: note: use option '-std=c99', '-std=gnu99', '-std=c11' or '-std=gnu11' to compile your code 4 | #define rep(v,e) for(long v=0;v<e;++v) | ^~~ main.c:24:17: note: in expansion of macro 'rep' 24 | rep(i,7)e[i]=a[i]; | ^~~ main.c:25:21: error: redefinition of 'i' 25 | rep(i,7)a[j%7]+=e[i],a[j%7]-=a[j%7]<MD?0:MD,j+=c[l]; | ^ main.c:4:27: note: in definition of macro 'rep' 4 | #define rep(v,e) for(long v=0;v<e;++v) | ^ main.c:24:21: note: previous definition of 'i' with type 'long int' 24 | rep(i,7)e[i]=a[i]; | ^ main.c:4:27: note: in definition of macro 'rep' 4 | #define rep(v,e) for(long v=0;v<e;++v) | ^ main.c:4:18: error: 'for' loop initial declarations are only allowed in C99 or C11 mode 4 | #define rep(v,e) for(long v=0;v<e;++v) | ^~~ main.c:25:17: note: in expansion of macro 'rep' 25 | rep(i,7)a[j%7]+=e[i],a[j%7]-=a[j%7]<MD?0:MD,j+=c[l]; | ^~~ main.c:5:21: error: 'for' loop initial declarations are only allowed in C99 or C11 mode 5 | #define rep3(v,s,e) for(long v=s;v<e;++v) | ^~~ main.c:29:17: note: in expansion of macro 'rep3' 29 | rep3(i,1,7)z+=i*a[i]; | ^~~~
ソースコード
#define rd_skip() while(*rp++>=48) #define rd() ({long _v=0,_c;while(_c=*rp++-48,_c>=0)_v=_v*10+_c;_v;}) #define wt(v) {ulong _z=v;do*--wp=_z%10+48;while(_z/=10);} #define rep(v,e) for(long v=0;v<e;++v) #define rep3(v,s,e) for(long v=s;v<e;++v) typedef unsigned long ulong; ulong a[7],e[7]; unsigned const b[]={0,1,4,6,5,2}; unsigned const c[]={1,3,2,6,4,5}; #define MD 1000000007 int main(){ a[0]=1; char*mmap(); char*rp=mmap(0l,1l<<25,1,2,0,0ll); rd_skip(); while(*rp){ ulong d=*rp-'0'; rp+=2; ulong l=(ulong)rd()%6; ulong j=d*b[l]; rep(i,7)e[i]=a[i]; rep(i,7)a[j%7]+=e[i],a[j%7]-=a[j%7]<MD?0:MD,j+=c[l]; } { ulong z=0; rep3(i,1,7)z+=i*a[i]; z%=MD; char wbuf[64],*wp=wbuf+sizeof wbuf; wt(z); write(1,wp,wbuf+sizeof wbuf-wp); } _exit(0); }