結果

問題 No.3009 異なる数字の最大の範囲(勉強会用)
ユーザー zutsuzutsu
提出日時 2022-05-15 11:53:18
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 257 bytes
コンパイル時間 323 ms
コンパイル使用メモリ 10,580 KB
実行使用メモリ 20,880 KB
最終ジャッジ日時 2023-09-03 17:02:30
合計ジャッジ時間 2,150 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 15 ms
7,772 KB
testcase_02 AC 16 ms
7,816 KB
testcase_03 AC 15 ms
7,796 KB
testcase_04 AC 15 ms
7,776 KB
testcase_05 WA -
testcase_06 AC 16 ms
7,896 KB
testcase_07 AC 15 ms
7,868 KB
testcase_08 WA -
testcase_09 AC 16 ms
7,868 KB
testcase_10 AC 15 ms
7,876 KB
testcase_11 AC 15 ms
7,904 KB
testcase_12 AC 16 ms
7,860 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 70 ms
20,880 KB
権限があれば一括ダウンロードができます

ソースコード

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