結果
| 問題 |
No.979 Longest Divisor Sequence
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-04-15 20:10:52 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 749 bytes |
| コンパイル時間 | 365 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 47,992 KB |
| 最終ジャッジ日時 | 2024-10-01 19:01:09 |
| 合計ジャッジ時間 | 6,010 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 3 WA * 11 TLE * 1 -- * 1 |
ソースコード
MOD = 10 ** 9 + 7
INF = 10 ** 12
import sys
sys.setrecursionlimit(1000000)
dy = (-1,0,1,0)
dx = (0,1,0,-1)
from itertools import permutations
def main():
n = int(input())
a = list(map(int,input().split()))
M = max(a)
ans = 2
flag = False
for i in range(2,int(M ** 0.5 + 1)):
before = a[0]
length = 1
power = i
for j in range(1,n):
if a[j]%power == 0 and before < a[j]:
length += 1
power *= i
else:
before = min(before,a[j])
if power != i:
flag = True
ans = max(ans,length)
if flag == False:
print(1)
else:
print(ans)
if __name__ =='__main__':
main()