結果
| 問題 |
No.8009 異なる数字の最大の範囲(勉強会用)
|
| ユーザー |
|
| 提出日時 | 2021-09-22 18:22:49 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 288 bytes |
| コンパイル時間 | 441 ms |
| コンパイル使用メモリ | 82,360 KB |
| 実行使用メモリ | 102,156 KB |
| 最終ジャッジ日時 | 2024-06-12 22:38:10 |
| 合計ジャッジ時間 | 2,360 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 7 WA * 15 |
ソースコード
from collections import defaultdict
N = int(input())
A = list(map(int, input().split()))
ans = 0
counter = defaultdict(int)
r = 0
for l in range(N):
while r < N and (not counter[A[r]]):
counter[A[r]] += 1
r += 1
ans = max(ans, r-l)
counter[l] -= 1
print(ans)