結果
| 問題 |
No.2779 Don't make Pair
|
| コンテスト | |
| ユーザー |
あじゃじゃ
|
| 提出日時 | 2024-06-07 22:27:43 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 436 bytes |
| コンパイル時間 | 179 ms |
| コンパイル使用メモリ | 82,304 KB |
| 実行使用メモリ | 107,392 KB |
| 最終ジャッジ日時 | 2024-12-26 08:36:00 |
| 合計ジャッジ時間 | 4,136 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 3 |
| other | WA * 24 |
ソースコード
from collections import defaultdict
dp=defaultdict(int)
indf=-1
N=int(input())
A=list(map(int,input().split()))
ind2=len(A)
for a in range(N):
if dp[A[a]]==2:
print(0)
exit()
elif dp[A[a]]==1:
indf = max(indf,dp[A[a]])
ind2=min(ind2,a)
dp[A[a]]+=1
if ind2==len(A):
print(N)
print([i+1 for i in range(N)])
exit()
ans= [i+1 for i in range(indf+1,ind2)]
print(len(ans))
print(*ans)
あじゃじゃ