結果

問題 No.390 最長の数列
ユーザー hogeover30hogeover30
提出日時 2016-09-20 23:47:47
言語 Ruby
(3.3.0)
結果
AC  
実行時間 794 ms / 5,000 ms
コード長 127 bytes
コンパイル時間 169 ms
コンパイル使用メモリ 7,680 KB
実行使用メモリ 28,032 KB
最終ジャッジ日時 2024-04-10 10:09:00
合計ジャッジ時間 5,915 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 162 ms
20,096 KB
testcase_01 AC 119 ms
19,968 KB
testcase_02 AC 155 ms
19,968 KB
testcase_03 AC 129 ms
20,096 KB
testcase_04 AC 152 ms
20,096 KB
testcase_05 AC 161 ms
27,904 KB
testcase_06 AC 794 ms
28,032 KB
testcase_07 AC 124 ms
19,968 KB
testcase_08 AC 93 ms
19,968 KB
testcase_09 AC 129 ms
19,968 KB
testcase_10 AC 229 ms
28,032 KB
testcase_11 AC 226 ms
27,904 KB
testcase_12 AC 233 ms
28,032 KB
testcase_13 AC 249 ms
26,240 KB
testcase_14 AC 733 ms
27,904 KB
testcase_15 AC 86 ms
20,096 KB
testcase_16 AC 91 ms
19,968 KB
testcase_17 AC 94 ms
20,096 KB
testcase_18 AC 97 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]>=0while m>j+=i};p c.max
0