結果
| 問題 | No.555 世界史のレポート |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-08-11 23:10:31 |
| 言語 | C (gcc 13.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 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 |
コンパイルメッセージ
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]);
}