結果
問題 | No.324 落ちてた閉路グラフ |
ユーザー | tails |
提出日時 | 2015-12-17 10:02:43 |
言語 | C90 (gcc 11.4.0) |
結果 |
AC
|
実行時間 | 13 ms / 5,000 ms |
コード長 | 458 bytes |
コンパイル時間 | 737 ms |
コンパイル使用メモリ | 20,992 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-15 19:29:48 |
合計ジャッジ時間 | 1,995 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
5,248 KB |
testcase_01 | AC | 1 ms
5,248 KB |
testcase_02 | AC | 0 ms
5,248 KB |
testcase_03 | AC | 0 ms
5,248 KB |
testcase_04 | AC | 12 ms
5,248 KB |
testcase_05 | AC | 12 ms
5,248 KB |
testcase_06 | AC | 12 ms
5,248 KB |
testcase_07 | AC | 13 ms
5,248 KB |
testcase_08 | AC | 12 ms
5,248 KB |
testcase_09 | AC | 13 ms
5,248 KB |
testcase_10 | AC | 12 ms
5,248 KB |
testcase_11 | AC | 12 ms
5,248 KB |
testcase_12 | AC | 11 ms
5,248 KB |
testcase_13 | AC | 4 ms
5,248 KB |
testcase_14 | AC | 2 ms
5,248 KB |
testcase_15 | AC | 2 ms
5,248 KB |
testcase_16 | AC | 1 ms
5,248 KB |
testcase_17 | AC | 1 ms
5,248 KB |
testcase_18 | AC | 1 ms
5,248 KB |
testcase_19 | AC | 1 ms
5,248 KB |
testcase_20 | AC | 1 ms
5,248 KB |
testcase_21 | AC | 0 ms
5,248 KB |
testcase_22 | AC | 1 ms
5,248 KB |
testcase_23 | AC | 1 ms
5,248 KB |
testcase_24 | AC | 0 ms
5,248 KB |
testcase_25 | AC | 1 ms
5,248 KB |
testcase_26 | AC | 1 ms
5,248 KB |
testcase_27 | AC | 1 ms
5,248 KB |
testcase_28 | AC | 1 ms
5,248 KB |
testcase_29 | AC | 1 ms
5,248 KB |
testcase_30 | AC | 1 ms
5,248 KB |
testcase_31 | AC | 1 ms
5,248 KB |
testcase_32 | AC | 12 ms
5,248 KB |
testcase_33 | AC | 13 ms
5,248 KB |
testcase_34 | AC | 8 ms
5,248 KB |
testcase_35 | AC | 1 ms
5,248 KB |
testcase_36 | AC | 6 ms
5,248 KB |
testcase_37 | AC | 1 ms
5,248 KB |
コンパイルメッセージ
main.c:1:1: warning: data definition has no type or storage class 1 | d[3010][2][2]; | ^ main.c:1:1: warning: type defaults to ‘int’ in declaration of ‘d’ [-Wimplicit-int] main.c:2:1: warning: data definition has no type or storage class 2 | w[3010]; | ^ main.c:2:1: warning: type defaults to ‘int’ in declaration of ‘w’ [-Wimplicit-int] main.c:3:1: warning: return type defaults to ‘int’ [-Wimplicit-int] 3 | max(a,b){return a>b?a:b;} | ^~~ main.c: In function ‘max’: main.c:3:1: warning: type of ‘a’ defaults to ‘int’ [-Wimplicit-int] main.c:3:1: warning: type of ‘b’ defaults to ‘int’ [-Wimplicit-int] main.c: At top level: main.c:4:1: warning: return type defaults to ‘int’ [-Wimplicit-int] 4 | main(i,j,k,n,m){ | ^~~~ main.c: In function ‘main’: main.c:4:1: warning: type of ‘i’ defaults to ‘int’ [-Wimplicit-int] main.c:4:1: warning: type of ‘j’ defaults to ‘int’ [-Wimplicit-int] main.c:4:1: warning: type of ‘k’ defaults to ‘int’ [-Wimplicit-int] main.c:4:1: warning: type of ‘n’ defaults to ‘int’ [-Wimplicit-int] main.c:4:1: warning: type of ‘m’ defaults to ‘int’ [-Wimplicit-int] main.c:5:9: warning: implicit declaration of function ‘scanf’ [-Wimplicit-function-declaration] 5 | scanf("%d%d",&n,&m); | ^~~~~ main.c:1:1: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’ +++ |+#include <stdio.h> 1 | d[3010][2][2]; main.c:5:9: warning: incompatible implicit declaration of built-in function ‘scanf’ [-Wbuiltin-declaration-mismatch] 5 | scanf("%d%d",&n,&m); | ^~~~~ main.c:5:9: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’ main.c:12:9: warning: implicit declaration of function ‘printf’ [-Wimplicit-function-declaration] 12 | printf("%d",max(max(d[m][0][0],d[m][0][1]),max(d[m][1][0],d[m][1][1]+w[n-1]))); | ^~~~~~ main.c:
ソースコード
d[3010][2][2]; w[3010]; max(a,b){return a>b?a:b;} main(i,j,k,n,m){ scanf("%d%d",&n,&m); for(i=0;i<n;++i)scanf("%d",w+i); for(k=n;k>=0;--k)for(j=0;j<2;++j)d[k][j][0]=d[k][j][1]=-999999; d[0][0][0]=d[1][1][1]=0; for(i=1;i<n;++i)for(k=i+1;k>=0;--k)for(j=0;j<2;++j) d[k][j][0]=max(d[k][j][0],d[k][j][1]), k&&(d[k][j][1]=max(d[k-1][j][0],d[k-1][j][1]+w[i-1])); printf("%d",max(max(d[m][0][0],d[m][0][1]),max(d[m][1][0],d[m][1][1]+w[n-1]))); return 0; }