結果
問題 | No.860 買い物 |
ユーザー | kotatsugame |
提出日時 | 2019-08-09 23:52:22 |
言語 | C (gcc 12.3.0) |
結果 |
AC
|
実行時間 | 26 ms / 1,000 ms |
コード長 | 133 bytes |
コンパイル時間 | 106 ms |
コンパイル使用メモリ | 28,416 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-19 16:00:15 |
合計ジャッジ時間 | 1,253 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
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 | 2 ms
5,376 KB |
testcase_07 | AC | 25 ms
5,376 KB |
testcase_08 | AC | 25 ms
5,376 KB |
testcase_09 | AC | 25 ms
5,376 KB |
testcase_10 | AC | 25 ms
5,376 KB |
testcase_11 | AC | 20 ms
5,376 KB |
testcase_12 | AC | 21 ms
5,376 KB |
testcase_13 | AC | 25 ms
5,376 KB |
testcase_14 | AC | 25 ms
5,376 KB |
testcase_15 | AC | 15 ms
5,376 KB |
testcase_16 | AC | 22 ms
5,376 KB |
testcase_17 | AC | 26 ms
5,376 KB |
コンパイルメッセージ
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("%ld",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("%ld",s+b); }