結果

問題 No.2779 Don't make Pair
ユーザー 👑 timitimi
提出日時 2024-06-07 21:41:19
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 432 bytes
コンパイル時間 444 ms
コンパイル使用メモリ 81,920 KB
実行使用メモリ 103,936 KB
最終ジャッジ日時 2024-06-07 21:41:28
合計ジャッジ時間 3,765 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
51,840 KB
testcase_01 WA -
testcase_02 AC 34 ms
52,224 KB
testcase_03 WA -
testcase_04 AC 35 ms
51,456 KB
testcase_05 AC 33 ms
51,584 KB
testcase_06 AC 34 ms
52,224 KB
testcase_07 AC 34 ms
51,584 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 75 ms
86,400 KB
testcase_13 AC 77 ms
87,296 KB
testcase_14 AC 80 ms
86,784 KB
testcase_15 AC 114 ms
103,936 KB
testcase_16 WA -
testcase_17 AC 101 ms
98,176 KB
testcase_18 AC 91 ms
92,672 KB
testcase_19 AC 103 ms
99,712 KB
testcase_20 AC 72 ms
80,256 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 131 ms
102,400 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 118 ms
102,528 KB
testcase_27 AC 124 ms
102,528 KB
testcase_28 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#N,K=map(int, input().split())
#A=list(map(int, input().split()))
N=int(input())
A=list(map(int, input().split()))
D={}
for i in range(N):
  a=A[i]
  if a not in D:
    D[a]=[]
  D[a].append(i)
  
l,r=1,N-1
for d in D:
  if len(D[d])>2:
    print(0)
    exit()
  if len(D[d])==2:
    ll,rr=D[d][0]+1,D[d][1]
    l=max(l,ll);r=min(r,rr)

if l<=r:
  ans=[i for i in range(l,r+1)]
  print(len(ans))
  print(*ans)
else:
  print(0)

    
0