結果

問題 No.127 門松もどき
ユーザー 👑 hos.lyrichos.lyric
提出日時 2015-01-30 14:48:46
言語 Ruby
(3.2.2)
結果
AC  
実行時間 2,199 ms / 5,000 ms
コード長 193 bytes
コンパイル時間 204 ms
コンパイル使用メモリ 11,672 KB
実行使用メモリ 75,404 KB
最終ジャッジ日時 2023-08-25 13:56:17
合計ジャッジ時間 26,214 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
15,156 KB
testcase_01 AC 71 ms
15,352 KB
testcase_02 AC 70 ms
15,032 KB
testcase_03 AC 73 ms
15,260 KB
testcase_04 AC 2,199 ms
75,404 KB
testcase_05 AC 73 ms
15,108 KB
testcase_06 AC 251 ms
27,288 KB
testcase_07 AC 74 ms
15,080 KB
testcase_08 AC 75 ms
15,080 KB
testcase_09 AC 75 ms
15,156 KB
testcase_10 AC 76 ms
15,076 KB
testcase_11 AC 79 ms
15,708 KB
testcase_12 AC 1,174 ms
49,192 KB
testcase_13 AC 1,522 ms
59,232 KB
testcase_14 AC 1,425 ms
56,200 KB
testcase_15 AC 1,927 ms
68,484 KB
testcase_16 AC 1,356 ms
54,904 KB
testcase_17 AC 1,574 ms
60,492 KB
testcase_18 AC 1,327 ms
53,684 KB
testcase_19 AC 858 ms
40,452 KB
testcase_20 AC 868 ms
40,516 KB
testcase_21 AC 443 ms
38,456 KB
testcase_22 AC 2,196 ms
74,120 KB
testcase_23 AC 2,157 ms
72,964 KB
testcase_24 AC 1,682 ms
62,320 KB
testcase_25 AC 1,986 ms
70,348 KB
testcase_26 AC 1,048 ms
44,644 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n=gets.to_i
a=[0]+gets.split.map(&:to_i)+[0]
p (0..n).inject([0,1].map{(0..n+1).map{0}}){|d,w|[0,1].map{|s|(0..n-w).map{|i|[d[s][i+1-s],(-1)**s==(a[i]<=>a[i+w+1])?1+d[1-s][i+s]:0].max}}}.max[0]
0