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