結果
| 問題 | No.8009 異なる数字の最大の範囲(勉強会用) |
| ユーザー |
tmentaiko
|
| 提出日時 | 2020-08-24 12:24:06 |
| 言語 | Python3 (3.15.2 + numpy 2.5.4 + scipy 1.18.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 101 ms / 5,000 ms |
| + 706µs | |
| コード長 | 207 bytes |
| 記録 | |
| コンパイル時間 | 56 ms |
| コンパイル使用メモリ | 14,720 KB |
| 実行使用メモリ | 23,008 KB |
| 最終ジャッジ日時 | 2026-11-04 20:12:17 |
| 合計ジャッジ時間 | 2,816 ms |
|
ジャッジサーバーID (参考情報) |
judge7_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 23 |
ソースコード
n=int(input())
a=list(map(int,input().split()))
s=set()
g=l=r=0
while r<n:
if not a[r] in s:
s.add(a[r])
g=max(g,r-l+1)
r+=1
else:
s.remove(a[l])
l+=1
print(g)
tmentaiko