結果
| 問題 |
No.2779 Don't make Pair
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-06-07 21:37:32 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 295 ms / 2,000 ms |
| コード長 | 601 bytes |
| コンパイル時間 | 284 ms |
| コンパイル使用メモリ | 82,048 KB |
| 実行使用メモリ | 139,008 KB |
| 最終ジャッジ日時 | 2024-12-26 07:21:47 |
| 合計ジャッジ時間 | 7,899 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 5 |
| other | AC * 24 |
ソースコード
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)