結果
| 問題 | No.8009 異なる数字の最大の範囲(勉強会用) |
| ユーザー |
|
| 提出日時 | 2021-09-22 18:24:19 |
| 言語 | PyPy3 (8.0.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 76 ms / 5,000 ms |
| + 424µs | |
| コード長 | 291 bytes |
| 記録 | |
| コンパイル時間 | 80 ms |
| コンパイル使用メモリ | 64,380 KB |
| 実行使用メモリ | 82,552 KB |
| 最終ジャッジ日時 | 2026-11-04 22:02:32 |
| 合計ジャッジ時間 | 3,167 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 23 |
ソースコード
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[A[l]] -= 1
print(ans)