結果

問題 No.555 世界史のレポート
ユーザー kotatsugamekotatsugame
提出日時 2017-08-11 23:05:43
言語 C
(gcc 12.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
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 WA -
testcase_02 AC 1 ms
5,248 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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

ソースコード

diff #

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]);
}
0