結果

問題 No.390 最長の数列
ユーザー hogeover30hogeover30
提出日時 2016-09-20 23:45:20
言語 Ruby
(3.3.0)
結果
AC  
実行時間 763 ms / 5,000 ms
コード長 128 bytes
コンパイル時間 111 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 28,160 KB
最終ジャッジ日時 2024-04-10 10:08:22
合計ジャッジ時間 5,099 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 167 ms
20,224 KB
testcase_01 AC 111 ms
20,096 KB
testcase_02 AC 145 ms
19,968 KB
testcase_03 AC 132 ms
19,840 KB
testcase_04 AC 157 ms
20,096 KB
testcase_05 AC 147 ms
28,160 KB
testcase_06 AC 734 ms
27,904 KB
testcase_07 AC 121 ms
19,968 KB
testcase_08 AC 86 ms
20,096 KB
testcase_09 AC 119 ms
20,224 KB
testcase_10 AC 222 ms
28,032 KB
testcase_11 AC 225 ms
27,904 KB
testcase_12 AC 246 ms
27,904 KB
testcase_13 AC 259 ms
26,368 KB
testcase_14 AC 763 ms
28,032 KB
testcase_15 AC 83 ms
20,096 KB
testcase_16 AC 88 ms
19,968 KB
testcase_17 AC 93 ms
20,096 KB
testcase_18 AC 100 ms
20,096 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

c=[-1]*m=1000001;gets;gets.split.map{|i|c[i=i.to_i]=1;i}.sort.map{|i|j=i;c[j]=[c[j],c[i]+1].max if c[j]>=0 while m>j+=i};p c.max
0