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