結果
問題 | No.2779 Don't make Pair |
ユーザー |
|
提出日時 | 2024-06-07 21:35:46 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 335 bytes |
コンパイル時間 | 182 ms |
コンパイル使用メモリ | 82,176 KB |
実行使用メモリ | 102,520 KB |
最終ジャッジ日時 | 2024-12-26 07:18:32 |
合計ジャッジ時間 | 3,626 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 WA * 1 |
other | AC * 20 WA * 4 |
ソースコード
from collections import defaultdictn = int(input())a = list(map(int, input().split()))m = 1M = n - 1d = defaultdict(list)for i in range(n):d[a[i]].append(i)for i, j in d.items():if len(j) > 2:exit(print(0))if len(j) == 2:m = max(m, j[0] + 1)M = min(M, j[1])ans = list(range(m, M + 1))print(len(ans))print(*ans)