結果

問題 No.8009 異なる数字の最大の範囲(勉強会用)
ユーザー zutsu
提出日時 2022-05-15 11:53:18
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 257 bytes
コンパイル時間 77 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 23,288 KB
最終ジャッジ日時 2024-06-12 22:39:27
合計ジャッジ時間 1,834 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 8 WA * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = list(map(int, input().split()))
S = set()
ans = 0
ct = 0
for a in A:
    if a not in S:
        S.add(a)
        ct += 1
    else:
        ans = max(ans, ct)
        ct = 1
        S.clear()
        S.add(a)
ans = max(ans,ct)
print(ans)
0