結果

問題 No.2779 Don't make Pair
ユーザー titiatitia
提出日時 2024-06-07 21:57:45
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 169 ms / 2,000 ms
コード長 386 bytes
コンパイル時間 125 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 23,848 KB
最終ジャッジ日時 2024-06-07 21:57:51
合計ジャッジ時間 3,093 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
10,752 KB
testcase_01 AC 27 ms
10,624 KB
testcase_02 AC 28 ms
10,624 KB
testcase_03 AC 27 ms
10,624 KB
testcase_04 AC 25 ms
10,496 KB
testcase_05 AC 24 ms
10,624 KB
testcase_06 AC 24 ms
10,496 KB
testcase_07 AC 24 ms
10,624 KB
testcase_08 AC 24 ms
10,624 KB
testcase_09 AC 29 ms
11,904 KB
testcase_10 AC 48 ms
19,264 KB
testcase_11 AC 31 ms
13,080 KB
testcase_12 AC 56 ms
16,888 KB
testcase_13 AC 64 ms
17,528 KB
testcase_14 AC 77 ms
17,076 KB
testcase_15 AC 82 ms
19,048 KB
testcase_16 AC 82 ms
19,432 KB
testcase_17 AC 99 ms
17,496 KB
testcase_18 AC 92 ms
17,460 KB
testcase_19 AC 89 ms
17,968 KB
testcase_20 AC 55 ms
16,388 KB
testcase_21 AC 90 ms
21,656 KB
testcase_22 AC 73 ms
21,524 KB
testcase_23 AC 169 ms
23,848 KB
testcase_24 AC 81 ms
21,396 KB
testcase_25 AC 81 ms
21,524 KB
testcase_26 AC 90 ms
21,652 KB
testcase_27 AC 96 ms
21,520 KB
testcase_28 AC 85 ms
21,524 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

N=int(input())
A=list(map(int,input().split()))

S=set()
right=N-1
left=0
for i in range(N):
    S.add(A[i])
    if len(S)!=i+1:
        right=i
        break

S=set()
for i in range(N):
    S.add(A[N-1-i])
    if len(S)!=i+1:
        left=N-1-i
        break

ANS=[]
for i in range(left+1,right+1):
    ANS.append(i)

print(len(ANS))
print(*ANS)
0