結果

問題 No.2218 Multiple LIS
ユーザー hiryuNhiryuN
提出日時 2023-02-17 23:02:51
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 704 ms / 3,000 ms
コード長 364 bytes
コンパイル時間 392 ms
コンパイル使用メモリ 86,972 KB
実行使用メモリ 92,420 KB
最終ジャッジ日時 2023-09-26 20:24:19
合計ジャッジ時間 10,921 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
76,676 KB
testcase_01 AC 74 ms
76,528 KB
testcase_02 AC 74 ms
76,756 KB
testcase_03 AC 72 ms
76,512 KB
testcase_04 AC 72 ms
76,500 KB
testcase_05 AC 73 ms
76,524 KB
testcase_06 AC 72 ms
76,768 KB
testcase_07 AC 76 ms
76,608 KB
testcase_08 AC 73 ms
76,800 KB
testcase_09 AC 73 ms
76,784 KB
testcase_10 AC 75 ms
76,796 KB
testcase_11 AC 74 ms
76,728 KB
testcase_12 AC 77 ms
77,532 KB
testcase_13 AC 81 ms
78,008 KB
testcase_14 AC 84 ms
78,112 KB
testcase_15 AC 84 ms
77,816 KB
testcase_16 AC 76 ms
76,752 KB
testcase_17 AC 86 ms
78,100 KB
testcase_18 AC 76 ms
76,472 KB
testcase_19 AC 78 ms
77,772 KB
testcase_20 AC 83 ms
77,808 KB
testcase_21 AC 106 ms
78,368 KB
testcase_22 AC 235 ms
82,088 KB
testcase_23 AC 347 ms
86,008 KB
testcase_24 AC 140 ms
78,288 KB
testcase_25 AC 382 ms
87,196 KB
testcase_26 AC 510 ms
92,168 KB
testcase_27 AC 509 ms
92,080 KB
testcase_28 AC 506 ms
92,224 KB
testcase_29 AC 508 ms
92,144 KB
testcase_30 AC 508 ms
92,140 KB
testcase_31 AC 212 ms
91,468 KB
testcase_32 AC 211 ms
91,488 KB
testcase_33 AC 215 ms
91,680 KB
testcase_34 AC 210 ms
91,584 KB
testcase_35 AC 216 ms
91,444 KB
testcase_36 AC 97 ms
90,660 KB
testcase_37 AC 704 ms
92,420 KB
testcase_38 AC 74 ms
76,692 KB
testcase_39 AC 73 ms
76,496 KB
testcase_40 AC 575 ms
92,076 KB
testcase_41 AC 572 ms
92,040 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
A=list(map(int,input().split()))
B=[0]+[0]+[-10**5]*10**5
for i in range(n):
    if A[i]!=1:
        B[A[i]]+=1
    B[A[i]]=max(B[1]+1,B[A[i]])
    for q in range(2,320):
        if q**2>A[i]:
            break
        if A[i]%q==0:
           B[A[i]]=max(B[A[i]],B[q]+1)
           B[A[i]]=max(B[A[i]],B[A[i]//q]+1)

ans=max(B)
#print(B)
print(ans)
0