結果
問題 | No.546 オンリー・ワン |
ユーザー | kotatsugame |
提出日時 | 2017-07-15 00:01:49 |
言語 | C (gcc 12.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 266 bytes |
コンパイル時間 | 328 ms |
コンパイル使用メモリ | 28,928 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-08 00:13:17 |
合計ジャッジ時間 | 946 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
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,816 KB |
testcase_04 | AC | 1 ms
6,816 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: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>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | g(a,b){return b?g(b,a%b):a;} main.c:10:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 10 | scanf("%d%d%d",&n,&l,&h); | ^~~~~ main.c:10:9: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:13:9: warning: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 13 | printf("%d",s); | ^~~~~~ main.c:13:9: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:13:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:13:9: note: include '<stdio.h>' or provide a declaration of 'printf'
ソースコード
g(a,b){return b?g(b,a%b):a;} long 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); }