結果

問題 No.3009 異なる数字の最大の範囲(勉強会用)
ユーザー yvay5cqeyvay5cqe
提出日時 2021-08-18 00:51:31
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 254 bytes
コンパイル時間 90 ms
コンパイル使用メモリ 10,628 KB
実行使用メモリ 21,376 KB
最終ジャッジ日時 2023-09-03 17:00:48
合計ジャッジ時間 2,092 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 13 ms
7,948 KB
testcase_01 WA -
testcase_02 AC 13 ms
7,860 KB
testcase_03 AC 13 ms
7,796 KB
testcase_04 AC 13 ms
7,932 KB
testcase_05 WA -
testcase_06 AC 13 ms
7,908 KB
testcase_07 AC 13 ms
7,816 KB
testcase_08 AC 13 ms
7,788 KB
testcase_09 AC 13 ms
7,772 KB
testcase_10 AC 13 ms
7,800 KB
testcase_11 AC 13 ms
7,744 KB
testcase_12 AC 15 ms
7,800 KB
testcase_13 WA -
testcase_14 AC 14 ms
7,772 KB
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 119 ms
21,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = list(map(int, input().split()))

l = 0
r = 0
ans = 0
st = set()
while l < n:
    if r <= l:
        r = l
    while r < n and a[r] not in st:
        st.add(a[r])
        ans = max(ans, len(st))
        r += 1
    l = r+1
print(ans)
0