結果

問題 No.555 世界史のレポート
コンテスト
ユーザー kotatsugame
提出日時 2017-08-11 23:10:31
言語 C(gnu17)
(gcc 15.2.0)
コンパイル:
gcc-15 -O2 -std=gnu17 -Wno-error=implicit-function-declaration -Wno-error=implicit-int -Wno-error=incompatible-pointer-types -Wno-error=int-conversion -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
CE  
(最新)
AC  
(最初)
実行時間 -
コード長 218 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 79 ms
コンパイル使用メモリ 25,940 KB
最終ジャッジ日時 2026-02-22 00:09:06
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。

コンパイルメッセージ
main.c:1:1: warning: data definition has no type or storage class
    1 | dp[114514];i;j;
      | ^~
main.c:1:1: error: 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: error: 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: error: type defaults to 'int' in declaration of 'j' [-Wimplicit-int]
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int]
    2 | main(n,c,v){
      | ^~~~
main.c: In function 'main':
main.c:2:1: warning: old-style function definition [-Wold-style-definition]
main.c:2:1: error: type of 'n' defaults to 'int' [-Wimplicit-int]
main.c:2:1: error: type of 'c' defaults to 'int' [-Wimplicit-int]
main.c:2:1: error: type of 'v' defaults to 'int' [-Wimplicit-int]
main.c:3:13: error: 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: error: 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

ソースコード

diff #
raw source code

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