結果
問題 | No.3009 異なる数字の最大の範囲(勉強会用) |
ユーザー | zaki_chemtech |
提出日時 | 2020-07-10 09:58:22 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 321 bytes |
コンパイル時間 | 345 ms |
コンパイル使用メモリ | 86,672 KB |
実行使用メモリ | 104,776 KB |
最終ジャッジ日時 | 2023-09-03 16:59:36 |
合計ジャッジ時間 | 3,140 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge13 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | WA | - |
testcase_01 | WA | - |
testcase_02 | AC | 64 ms
71,252 KB |
testcase_03 | AC | 65 ms
71,188 KB |
testcase_04 | AC | 61 ms
71,352 KB |
testcase_05 | WA | - |
testcase_06 | AC | 61 ms
70,976 KB |
testcase_07 | AC | 61 ms
71,140 KB |
testcase_08 | AC | 62 ms
70,972 KB |
testcase_09 | AC | 67 ms
71,516 KB |
testcase_10 | AC | 63 ms
70,976 KB |
testcase_11 | AC | 61 ms
71,392 KB |
testcase_12 | AC | 61 ms
71,156 KB |
testcase_13 | AC | 65 ms
71,376 KB |
testcase_14 | AC | 66 ms
71,176 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 | 96 ms
104,148 KB |
ソースコード
n=int(input()) a = list(map(int,input().split())) head = 0 check = {a[0]:0} ans = 0 for tail in range(1,n): if a[tail] in check: ans = max(ans, tail-head) head = check[a[tail]]+1 check[a[tail]] = tail else: check[a[tail]] = 1 #print(ans) ans = max(ans, n-head) print(ans)