結果
問題 | No.555 世界史のレポート |
ユーザー | kotatsugame |
提出日時 | 2017-08-11 23:10:31 |
言語 | C (gcc 12.3.0) |
結果 |
AC
|
実行時間 | 8 ms / 2,000 ms |
コード長 | 218 bytes |
コンパイル時間 | 339 ms |
コンパイル使用メモリ | 29,824 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-12 21:45:38 |
合計ジャッジ時間 | 1,122 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 4 ms
5,248 KB |
testcase_01 | AC | 4 ms
5,248 KB |
testcase_02 | AC | 5 ms
5,248 KB |
testcase_03 | AC | 6 ms
5,248 KB |
testcase_04 | AC | 6 ms
5,248 KB |
testcase_05 | AC | 6 ms
5,248 KB |
testcase_06 | AC | 6 ms
5,248 KB |
testcase_07 | AC | 6 ms
5,248 KB |
testcase_08 | AC | 6 ms
5,248 KB |
testcase_09 | AC | 7 ms
5,248 KB |
testcase_10 | AC | 8 ms
5,248 KB |
testcase_11 | AC | 8 ms
5,248 KB |
testcase_12 | AC | 8 ms
5,248 KB |
testcase_13 | AC | 8 ms
5,248 KB |
testcase_14 | AC | 8 ms
5,248 KB |
testcase_15 | AC | 8 ms
5,248 KB |
testcase_16 | AC | 8 ms
5,248 KB |
testcase_17 | AC | 8 ms
5,248 KB |
testcase_18 | AC | 8 ms
5,248 KB |
testcase_19 | AC | 7 ms
5,248 KB |
コンパイルメッセージ
main.c:1:1: warning: data definition has no type or storage class 1 | dp[114514];i;j; | ^~ main.c:1:1: warning: type defaults to 'int' in declaration of 'dp' [-Wimplicit-int] main.c:1:12: warning: data definition has no type or storage class 1 | dp[114514];i;j; | ^ main.c:1:12: warning: type defaults to 'int' in declaration of 'i' [-Wimplicit-int] main.c:1:14: warning: data definition has no type or storage class 1 | dp[114514];i;j; | ^ main.c:1:14: warning: type defaults to 'int' in declaration of 'j' [-Wimplicit-int] main.c:2:1: warning: return type defaults to 'int' [-Wimplicit-int] 2 | main(n,c,v){ | ^~~~ main.c: In function 'main': main.c:2:1: warning: type of 'n' defaults to 'int' [-Wimplicit-int] main.c:2:1: warning: type of 'c' defaults to 'int' [-Wimplicit-int] main.c:2:1: warning: type of 'v' defaults to 'int' [-Wimplicit-int] main.c:3:13: warning: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 3 | for(scanf("%d%d%d",&n,&c,&v);i++<n;) | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | dp[114514];i;j; main.c:3:13: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 3 | for(scanf("%d%d%d",&n,&c,&v);i++<n;) | ^~~~~ main.c:3:13: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:5:48: warning: implicit declaration of function 'fmin' [-Wimplicit-function-declaration] 5 | for(j=2;j*i<114514;j++)dp[j*i]=fmin(dp[j*i]?dp[j*i]:1e9,dp[i]+c+v*~-j); | ^~~~ main.c:1:1: note: include '<math.h>' or provide a declaration of 'fmin' +++ |+#include <math.h> 1 | dp[114514];i;j; main.c:5:48: warning: incompatible implicit declaration of built-in function 'fmin' [-Wbuiltin-declaration-mismatch] 5 |
ソースコード
dp[114514];i;j; main(n,c,v){ for(scanf("%d%d%d",&n,&c,&v);i++<n;) { for(j=2;j*i<114514;j++)dp[j*i]=fmin(dp[j*i]?dp[j*i]:1e9,dp[i]+c+v*~-j); } for(i=n;i<114514;i++)dp[n]=fmin(dp[n],dp[i]); printf("%d\n",dp[n]); }