結果
問題 | No.324 落ちてた閉路グラフ |
ユーザー | %20 |
提出日時 | 2017-09-29 19:52:05 |
言語 | C (gcc 12.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 585 bytes |
コンパイル時間 | 372 ms |
コンパイル使用メモリ | 31,232 KB |
実行使用メモリ | 142,720 KB |
最終ジャッジ日時 | 2024-11-15 19:55:51 |
合計ジャッジ時間 | 3,306 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 38 ms
142,532 KB |
testcase_01 | AC | 40 ms
142,532 KB |
testcase_02 | AC | 39 ms
142,592 KB |
testcase_03 | AC | 38 ms
142,568 KB |
testcase_04 | AC | 50 ms
142,592 KB |
testcase_05 | AC | 67 ms
142,464 KB |
testcase_06 | WA | - |
testcase_07 | AC | 64 ms
142,564 KB |
testcase_08 | WA | - |
testcase_09 | WA | - |
testcase_10 | WA | - |
testcase_11 | AC | 43 ms
142,512 KB |
testcase_12 | WA | - |
testcase_13 | AC | 38 ms
142,516 KB |
testcase_14 | AC | 41 ms
142,572 KB |
testcase_15 | AC | 43 ms
142,540 KB |
testcase_16 | WA | - |
testcase_17 | AC | 38 ms
142,536 KB |
testcase_18 | AC | 40 ms
142,572 KB |
testcase_19 | AC | 40 ms
142,592 KB |
testcase_20 | WA | - |
testcase_21 | WA | - |
testcase_22 | AC | 38 ms
142,532 KB |
testcase_23 | AC | 41 ms
142,592 KB |
testcase_24 | WA | - |
testcase_25 | AC | 39 ms
142,468 KB |
testcase_26 | AC | 40 ms
142,592 KB |
testcase_27 | AC | 39 ms
142,544 KB |
testcase_28 | AC | 39 ms
142,464 KB |
testcase_29 | WA | - |
testcase_30 | AC | 40 ms
142,464 KB |
testcase_31 | AC | 40 ms
142,464 KB |
testcase_32 | AC | 66 ms
142,552 KB |
testcase_33 | AC | 62 ms
142,592 KB |
testcase_34 | AC | 49 ms
142,592 KB |
testcase_35 | AC | 38 ms
142,572 KB |
testcase_36 | WA | - |
testcase_37 | WA | - |
コンパイルメッセージ
main.c:1:1: warning: return type defaults to 'int' [-Wimplicit-int] 1 | max(a,b){return a>b?a:b;} | ^~~ main.c: In function 'max': main.c:1:1: warning: type of 'a' defaults to 'int' [-Wimplicit-int] main.c:1:1: warning: type of 'b' defaults to 'int' [-Wimplicit-int] main.c: At top level: main.c:2:1: warning: data definition has no type or storage class 2 | n,m,w[3001]; | ^ main.c:2:1: warning: type defaults to 'int' in declaration of 'n' [-Wimplicit-int] main.c:2:3: warning: type defaults to 'int' in declaration of 'm' [-Wimplicit-int] 2 | n,m,w[3001]; | ^ main.c:2:5: warning: type defaults to 'int' in declaration of 'w' [-Wimplicit-int] 2 | n,m,w[3001]; | ^ main.c:3:1: warning: data definition has no type or storage class 3 | i,j,k,d[3001][3001][4]; | ^ main.c:3:1: warning: type defaults to 'int' in declaration of 'i' [-Wimplicit-int] main.c:3:3: warning: type defaults to 'int' in declaration of 'j' [-Wimplicit-int] 3 | i,j,k,d[3001][3001][4]; | ^ main.c:3:5: warning: type defaults to 'int' in declaration of 'k' [-Wimplicit-int] 3 | i,j,k,d[3001][3001][4]; | ^ main.c:3:7: warning: type defaults to 'int' in declaration of 'd' [-Wimplicit-int] 3 | i,j,k,d[3001][3001][4]; | ^ main.c:4:1: warning: return type defaults to 'int' [-Wimplicit-int] 4 | main(){ | ^~~~ main.c: In function 'main': main.c:9:9: warning: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 9 | scanf("%d%d",&n,&m); | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | max(a,b){return a>b?a:b;} main.c:9:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 9 | scanf("%d%d",&n,&m); | ^~~~~ main.c:9:9: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:21:9: warning: implicit declaration o
ソースコード
max(a,b){return a>b?a:b;} n,m,w[3001]; i,j,k,d[3001][3001][4]; main(){ for(i=0;i<3001;++i) for(j=0;j<3001;++j) for(k=0;k<4;++k) d[i][j][k]=-1e9; scanf("%d%d",&n,&m); for(i=1;i<=n;++i)scanf("%d",w+i); d[1][0][0]=0; d[1][1][3]=0; for(i=2;i<=n;++i){ for(j=1;j<=m;++j){ d[i][j][0]=max(d[i-1][j][0],d[i-1][j][1]); d[i][j][1]=max(d[i-1][j-1][0],d[i-1][j-1][1]+w[i-1]); d[i][j][2]=max(d[i-1][j][2],d[i-1][j][3]); d[i][j][3]=max(d[i-1][j-1][2],d[i-1][j-1][3]+w[i-1]); } } printf("%d",max( max(d[n][m][0],d[n][m][1]), max(d[n][m][2],d[n][m][3]+w[n]) )); }