結果
| 問題 | No.8009 異なる数字の最大の範囲(勉強会用) |
| ユーザー |
|
| 提出日時 | 2024-04-20 06:18:23 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 84 ms / 5,000 ms |
| コード長 | 355 bytes |
| 記録 | |
| コンパイル時間 | 279 ms |
| コンパイル使用メモリ | 85,120 KB |
| 実行使用メモリ | 96,640 KB |
| 最終ジャッジ日時 | 2026-04-28 12:08:48 |
| 合計ジャッジ時間 | 2,847 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 22 |
ソースコード
N = int(input())
A = list(map(int, input().split()))
l = 0
r = 0
s = set()
mx = 0
while r < N:
if A[r] not in s:
s.add(A[r])
if len(s) > mx:
mx = len(s)
r += 1
else:
while A[l] != A[r]:
# print(l, r, s)
s.discard(A[l])
l += 1
l += 1
r += 1
print(mx)