結果
問題 | No.546 オンリー・ワン |
ユーザー | kotatsugame |
提出日時 | 2017-07-14 23:59:46 |
言語 | C (gcc 12.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 261 bytes |
コンパイル時間 | 248 ms |
コンパイル使用メモリ | 28,544 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-10-08 00:11:28 |
合計ジャッジ時間 | 781 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
6,816 KB |
testcase_01 | AC | 1 ms
6,816 KB |
testcase_02 | AC | 1 ms
6,816 KB |
testcase_03 | AC | 1 ms
6,820 KB |
testcase_04 | AC | 1 ms
6,820 KB |
testcase_05 | AC | 1 ms
6,816 KB |
testcase_06 | AC | 1 ms
6,816 KB |
testcase_07 | WA | - |
testcase_08 | AC | 1 ms
6,816 KB |
testcase_09 | WA | - |
testcase_10 | WA | - |
コンパイルメッセージ
main.c:1:1: warning: return type defaults to 'int' [-Wimplicit-int] 1 | g(a,b){return b?g(b,a%b):a;} | ^ main.c: In function 'g': main.c:1:1: warning: type of 'a' defaults to 'int' [-Wimplicit-int] main.c:1:1: warning: type of 'b' defaults to 'int' [-Wimplicit-int] main.c: At top level: main.c:2:1: warning: data definition has no type or storage class 2 | n,l,h,c[10],s,r,i; | ^ main.c:2:1: warning: type defaults to 'int' in declaration of 'n' [-Wimplicit-int] main.c:2:3: warning: type defaults to 'int' in declaration of 'l' [-Wimplicit-int] 2 | n,l,h,c[10],s,r,i; | ^ main.c:2:5: warning: type defaults to 'int' in declaration of 'h' [-Wimplicit-int] 2 | n,l,h,c[10],s,r,i; | ^ main.c:2:7: warning: type defaults to 'int' in declaration of 'c' [-Wimplicit-int] 2 | n,l,h,c[10],s,r,i; | ^ main.c:2:13: warning: type defaults to 'int' in declaration of 's' [-Wimplicit-int] 2 | n,l,h,c[10],s,r,i; | ^ main.c:2:15: warning: type defaults to 'int' in declaration of 'r' [-Wimplicit-int] 2 | n,l,h,c[10],s,r,i; | ^ main.c:2:17: warning: type defaults to 'int' in declaration of 'i' [-Wimplicit-int] 2 | n,l,h,c[10],s,r,i; | ^ main.c:3:1: warning: return type defaults to 'int' [-Wimplicit-int] 3 | f(i,w,t,p) | ^ main.c: In function 'f': main.c:3:1: warning: type of 'i' defaults to 'int' [-Wimplicit-int] main.c:3:1: warning: type of 'w' defaults to 'int' [-Wimplicit-int] main.c:3:1: warning: type of 't' defaults to 'int' [-Wimplicit-int] main.c:3:1: warning: type of 'p' defaults to 'int' [-Wimplicit-int] main.c: At top level: main.c:8:1: warning: return type defaults to 'int' [-Wimplicit-int] 8 | main() | ^~~~ main.c: In function 'main': main.c:10:9: warning: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 10 | scanf("%d%d%d",&n,&l,&h); | ^~~~~ main.c:1:1: note: include '<stdio.h>'
ソースコード
g(a,b){return b?g(b,a%b):a;} n,l,h,c[10],s,r,i; f(i,w,t,p) { if(!t)s+=(h/w-l/w)*r*p; else if(i<n)f(i+1,w*c[i]/g(w,c[i]),t-1,p),f(i+1,w,t,p); } main() { scanf("%d%d%d",&n,&l,&h); for(l--;~scanf("%d",c+i++);); for(;r++<n;)f(0,1,r,r%2*2-1); printf("%d",s); }