結果
問題 | No.860 買い物 |
ユーザー | kotatsugame |
提出日時 | 2019-08-09 23:51:02 |
言語 | C (gcc 12.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 132 bytes |
コンパイル時間 | 181 ms |
コンパイル使用メモリ | 28,800 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-19 16:00:13 |
合計ジャッジ時間 | 1,255 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
5,248 KB |
testcase_01 | AC | 1 ms
5,376 KB |
testcase_02 | AC | 1 ms
5,376 KB |
testcase_03 | AC | 1 ms
5,376 KB |
testcase_04 | AC | 1 ms
5,376 KB |
testcase_05 | AC | 1 ms
5,376 KB |
testcase_06 | AC | 1 ms
5,376 KB |
testcase_07 | WA | - |
testcase_08 | WA | - |
testcase_09 | WA | - |
testcase_10 | WA | - |
testcase_11 | AC | 18 ms
5,376 KB |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | AC | 14 ms
5,376 KB |
testcase_16 | WA | - |
testcase_17 | WA | - |
コンパイルメッセージ
main.c:1:16: warning: data definition has no type or storage class 1 | long s,a=2e9,b;i; | ^ main.c:1:16: warning: type defaults to 'int' in declaration of 'i' [-Wimplicit-int] main.c:2:1: warning: return type defaults to 'int' [-Wimplicit-int] 2 | main(C,D){ | ^~~~ main.c: In function 'main': main.c:2:1: warning: type of 'C' defaults to 'int' [-Wimplicit-int] main.c:2:1: warning: type of 'D' defaults to 'int' [-Wimplicit-int] main.c:3:13: warning: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 3 | for(scanf("%*d");~scanf("%d%d",&C,&D);s+=C+D)a=fmin(a,b-D),b=fmin(i++?b:a+C,a+C); | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | long s,a=2e9,b;i; main.c:3:13: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 3 | for(scanf("%*d");~scanf("%d%d",&C,&D);s+=C+D)a=fmin(a,b-D),b=fmin(i++?b:a+C,a+C); | ^~~~~ main.c:3:13: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:3:56: warning: implicit declaration of function 'fmin' [-Wimplicit-function-declaration] 3 | for(scanf("%*d");~scanf("%d%d",&C,&D);s+=C+D)a=fmin(a,b-D),b=fmin(i++?b:a+C,a+C); | ^~~~ main.c:1:1: note: include '<math.h>' or provide a declaration of 'fmin' +++ |+#include <math.h> 1 | long s,a=2e9,b;i; main.c:3:56: warning: incompatible implicit declaration of built-in function 'fmin' [-Wbuiltin-declaration-mismatch] 3 | for(scanf("%*d");~scanf("%d%d",&C,&D);s+=C+D)a=fmin(a,b-D),b=fmin(i++?b:a+C,a+C); | ^~~~ main.c:3:56: note: include '<math.h>' or provide a declaration of 'fmin' main.c:4:9: warning: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 4 | printf("%d",s+
ソースコード
long s,a=2e9,b;i; main(C,D){ for(scanf("%*d");~scanf("%d%d",&C,&D);s+=C+D)a=fmin(a,b-D),b=fmin(i++?b:a+C,a+C); printf("%d",s+b); }