結果
| 問題 |
No.8009 異なる数字の最大の範囲(勉強会用)
|
| ユーザー |
tmentaiko
|
| 提出日時 | 2020-08-24 12:24:06 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 176 ms / 5,000 ms |
| コード長 | 207 bytes |
| コンパイル時間 | 104 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 23,556 KB |
| 最終ジャッジ日時 | 2024-11-20 15:02:21 |
| 合計ジャッジ時間 | 2,479 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 22 |
ソースコード
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