結果

問題 No.3009 異なる数字の最大の範囲(勉強会用)
ユーザー zaki_chemtechzaki_chemtech
提出日時 2020-07-10 09:50:09
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 307 bytes
コンパイル時間 303 ms
コンパイル使用メモリ 86,848 KB
実行使用メモリ 104,152 KB
最終ジャッジ日時 2023-09-03 16:59:19
合計ジャッジ時間 3,061 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 60 ms
71,164 KB
testcase_02 AC 60 ms
71,300 KB
testcase_03 AC 59 ms
71,120 KB
testcase_04 AC 60 ms
71,312 KB
testcase_05 WA -
testcase_06 AC 59 ms
71,168 KB
testcase_07 AC 61 ms
71,120 KB
testcase_08 WA -
testcase_09 AC 59 ms
71,236 KB
testcase_10 AC 59 ms
71,308 KB
testcase_11 AC 59 ms
71,012 KB
testcase_12 AC 61 ms
71,312 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 95 ms
104,152 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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)
0