結果
問題 |
No.8009 異なる数字の最大の範囲(勉強会用)
|
ユーザー |
![]() |
提出日時 | 2020-07-10 09:50:09 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 307 bytes |
コンパイル時間 | 305 ms |
コンパイル使用メモリ | 82,500 KB |
実行使用メモリ | 96,188 KB |
最終ジャッジ日時 | 2024-06-12 22:36:43 |
合計ジャッジ時間 | 2,170 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 8 WA * 14 |
ソースコード
n=int(input()) a = list(map(int,input().split())) head = 0 check = {a[0]:1} ans = 0 for tail in range(1,n): if a[tail] in check: ans = max(ans, tail-head) head = tail check = {a[tail]:1} else: check[a[tail]] = 1 #print(ans) ans = max(ans, n-head) print(ans)