結果

問題 No.2779 Don't make Pair
ユーザー hato336hato336
提出日時 2024-06-07 21:37:32
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 216 ms / 2,000 ms
コード長 601 bytes
コンパイル時間 149 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 139,264 KB
最終ジャッジ日時 2024-06-07 21:37:43
合計ジャッジ時間 6,009 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 132 ms
85,376 KB
testcase_01 AC 131 ms
85,504 KB
testcase_02 AC 127 ms
85,504 KB
testcase_03 AC 127 ms
85,504 KB
testcase_04 AC 125 ms
85,376 KB
testcase_05 AC 124 ms
85,504 KB
testcase_06 AC 124 ms
85,632 KB
testcase_07 AC 130 ms
85,504 KB
testcase_08 AC 133 ms
85,504 KB
testcase_09 AC 135 ms
89,728 KB
testcase_10 AC 150 ms
101,248 KB
testcase_11 AC 139 ms
91,136 KB
testcase_12 AC 161 ms
100,736 KB
testcase_13 AC 169 ms
101,248 KB
testcase_14 AC 163 ms
101,120 KB
testcase_15 AC 195 ms
112,128 KB
testcase_16 AC 170 ms
112,896 KB
testcase_17 AC 181 ms
114,304 KB
testcase_18 AC 175 ms
108,416 KB
testcase_19 AC 173 ms
108,800 KB
testcase_20 AC 155 ms
96,256 KB
testcase_21 AC 173 ms
116,736 KB
testcase_22 AC 177 ms
109,440 KB
testcase_23 AC 216 ms
139,264 KB
testcase_24 AC 170 ms
113,024 KB
testcase_25 AC 172 ms
113,536 KB
testcase_26 AC 182 ms
119,424 KB
testcase_27 AC 187 ms
121,344 KB
testcase_28 AC 187 ms
118,272 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import collections,sys,math,functools,operator,itertools,bisect,heapq,decimal,string,time,random
#sys.setrecursionlimit(10**9)
#sys.set_int_max_str_digits(0)
#input = sys.stdin.readline

#
#alist = []

n = int(input())
a = list(map(int,input().split()))
x = [0 for i in range(n)]
s = set()
for i in range(n):
    if a[i] in s:
        break
    s.add(a[i])
    x[i] = 1
y = [0 for i in range(n)]
s = set()
for i in reversed(range(n)):
    if a[i] in s:
        break
    s.add(a[i])
    y[i] = 1
ans = []
for i in range(n-1):
    if x[i] and y[i+1]:
        ans.append(i+1)
print(len(ans))
print(*ans)
0