結果
問題 | No.1730 GCD on Blackboard in yukicoder |
ユーザー | googol_S0 |
提出日時 | 2021-11-05 21:26:26 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 322 bytes |
コンパイル時間 | 258 ms |
コンパイル使用メモリ | 82,592 KB |
実行使用メモリ | 122,928 KB |
最終ジャッジ日時 | 2024-04-24 05:12:46 |
合計ジャッジ時間 | 6,728 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 206 ms
122,464 KB |
testcase_01 | AC | 129 ms
91,128 KB |
testcase_02 | AC | 144 ms
91,520 KB |
testcase_03 | WA | - |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | WA | - |
testcase_08 | WA | - |
testcase_09 | WA | - |
testcase_10 | WA | - |
testcase_11 | WA | - |
testcase_12 | AC | 135 ms
91,308 KB |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | WA | - |
testcase_16 | WA | - |
testcase_17 | WA | - |
testcase_18 | WA | - |
testcase_19 | WA | - |
testcase_20 | WA | - |
testcase_21 | WA | - |
testcase_22 | AC | 202 ms
122,528 KB |
testcase_23 | WA | - |
testcase_24 | WA | - |
testcase_25 | WA | - |
ソースコード
N=int(input()) A=list(map(int,input().split())) M=10**6+3 C=[0]*M for i in range(N): C[A[i]]+=1 X=[0]*M for i in range(2,M): for j in range(i,M,i): X[i]+=C[j] ANS=[0]*(N+1) for i in range(M): ANS[X[i]]=max(ANS[X[i]],i) for i in range(N-1,-1,-1): ANS[i]=max(ANS[i],ANS[i+1]) for i in range(N): print(ANS[N-i])