結果
問題 |
No.8009 異なる数字の最大の範囲(勉強会用)
|
ユーザー |
|
提出日時 | 2022-05-15 21:35:13 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 336 bytes |
コンパイル時間 | 191 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 20,412 KB |
最終ジャッジ日時 | 2024-06-12 22:39:57 |
合計ジャッジ時間 | 15,771 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | AC * 16 WA * 5 TLE * 1 |
ソースコード
from collections import deque N = int(input()) A = list(map(int, input().split())) ans = 0 ct = 0 q = deque() for a in A: if a not in q: q.append(a) ct += 1 else: ans = max(ans, ct) while q[0] != a: q.popleft() ct -= 1 q.popleft() q.append(a) print(ans)