結果
| 問題 |
No.555 世界史のレポート
|
| ユーザー |
|
| 提出日時 | 2017-08-11 23:05:43 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 166 bytes |
| コンパイル時間 | 1,140 ms |
| コンパイル使用メモリ | 29,184 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-10-12 21:44:31 |
| 合計ジャッジ時間 | 844 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 2 WA * 18 |
コンパイルメッセージ
main.c:1:1: warning: data definition has no type or storage class
1 | dp[50505];i;j;
| ^~
main.c:1:1: warning: type defaults to 'int' in declaration of 'dp' [-Wimplicit-int]
main.c:1:11: warning: data definition has no type or storage class
1 | dp[50505];i;j;
| ^
main.c:1:11: warning: type defaults to 'int' in declaration of 'i' [-Wimplicit-int]
main.c:1:13: warning: data definition has no type or storage class
1 | dp[50505];i;j;
| ^
main.c:1:13: 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[50505];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:44: warning: implicit declaration of function 'fmin' [-Wimplicit-function-declaration]
5 | for(j=2;j*i<=n;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[50505];i;j;
main.c:5:44: warning: incompatible implicit declaration of built-in function 'fmin' [-Wbuiltin-declaration-mismatch]
5 | for(j=2;j*i<=n
ソースコード
dp[50505];i;j;
main(n,c,v){
for(scanf("%d%d%d",&n,&c,&v);i++<n;)
{
for(j=2;j*i<=n;j++)dp[j*i]=fmin(dp[j*i]?dp[j*i]:1e9,dp[i]+c+v*~-j);
}
printf("%d\n",dp[n]);
}