結果
問題 | No.324 落ちてた閉路グラフ |
ユーザー | tails |
提出日時 | 2015-12-17 10:20:59 |
言語 | C90 (gcc 11.4.0) |
結果 |
AC
|
実行時間 | 12 ms / 5,000 ms |
コード長 | 466 bytes |
コンパイル時間 | 384 ms |
コンパイル使用メモリ | 20,992 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-04-27 16:00:08 |
合計ジャッジ時間 | 1,342 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
5,248 KB |
testcase_01 | AC | 0 ms
5,376 KB |
testcase_02 | AC | 0 ms
5,376 KB |
testcase_03 | AC | 1 ms
5,376 KB |
testcase_04 | AC | 12 ms
5,376 KB |
testcase_05 | AC | 11 ms
5,376 KB |
testcase_06 | AC | 11 ms
5,376 KB |
testcase_07 | AC | 11 ms
5,376 KB |
testcase_08 | AC | 12 ms
5,376 KB |
testcase_09 | AC | 12 ms
5,376 KB |
testcase_10 | AC | 12 ms
5,376 KB |
testcase_11 | AC | 12 ms
5,376 KB |
testcase_12 | AC | 10 ms
5,376 KB |
testcase_13 | AC | 4 ms
5,376 KB |
testcase_14 | AC | 1 ms
5,376 KB |
testcase_15 | AC | 2 ms
5,376 KB |
testcase_16 | AC | 1 ms
5,376 KB |
testcase_17 | AC | 0 ms
5,376 KB |
testcase_18 | AC | 1 ms
5,376 KB |
testcase_19 | AC | 1 ms
5,376 KB |
testcase_20 | AC | 1 ms
5,376 KB |
testcase_21 | AC | 1 ms
5,376 KB |
testcase_22 | AC | 0 ms
5,376 KB |
testcase_23 | AC | 0 ms
5,376 KB |
testcase_24 | AC | 1 ms
5,376 KB |
testcase_25 | AC | 0 ms
5,376 KB |
testcase_26 | AC | 1 ms
5,376 KB |
testcase_27 | AC | 0 ms
5,376 KB |
testcase_28 | AC | 0 ms
5,376 KB |
testcase_29 | AC | 1 ms
5,376 KB |
testcase_30 | AC | 1 ms
5,376 KB |
testcase_31 | AC | 1 ms
5,376 KB |
testcase_32 | AC | 11 ms
5,376 KB |
testcase_33 | AC | 12 ms
5,376 KB |
testcase_34 | AC | 8 ms
5,376 KB |
testcase_35 | AC | 1 ms
5,376 KB |
testcase_36 | AC | 5 ms
5,376 KB |
testcase_37 | AC | 0 ms
5,376 KB |
コンパイルメッセージ
main.c:1:1: warning: data definition has no type or storage class 1 | d00[3010],d01[3010],d10[3010],d11[3010]; | ^~~ main.c:1:1: warning: type defaults to ‘int’ in declaration of ‘d00’ [-Wimplicit-int] main.c:1:11: warning: type defaults to ‘int’ in declaration of ‘d01’ [-Wimplicit-int] 1 | d00[3010],d01[3010],d10[3010],d11[3010]; | ^~~ main.c:1:21: warning: type defaults to ‘int’ in declaration of ‘d10’ [-Wimplicit-int] 1 | d00[3010],d01[3010],d10[3010],d11[3010]; | ^~~ main.c:1:31: warning: type defaults to ‘int’ in declaration of ‘d11’ [-Wimplicit-int] 1 | d00[3010],d01[3010],d10[3010],d11[3010]; | ^~~ 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,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 ‘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 | d00[3010],d01[3010],d10[3010
ソースコード
d00[3010],d01[3010],d10[3010],d11[3010]; w[3010]; max(a,b){return a>b?a:b;} main(i,k,n,m){ scanf("%d%d",&n,&m); for(i=0;i<n;++i)scanf("%d",w+i); for(k=n;k>=0;--k)d00[k]=d01[k]=d10[k]=d11[k]=-999999; d00[0]=d11[1]=0; for(i=0;i<n-1;++i)for(k=i+3;--k;) d00[k]=max(d00[k],d01[k]), d10[k]=max(d10[k],d11[k]), d01[k]=max(d00[k-1],d01[k-1]+w[i]), d11[k]=max(d10[k-1],d11[k-1]+w[i]); printf("%d",max(max(d00[m],d01[m]),max(d10[m],d11[m]+w[n-1]))); return 0; }