結果
| 問題 | No.2779 Don't make Pair |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-06-07 21:37:00 |
| 言語 | PyPy3 (8.0.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 77 ms / 2,000 ms |
| + 378µs | |
| コード長 | 345 bytes |
| 記録 | |
| コンパイル時間 | 64 ms |
| コンパイル使用メモリ | 81,996 KB |
| 実行使用メモリ | 117,964 KB |
| 最終ジャッジ日時 | 2026-10-08 05:12:20 |
| 合計ジャッジ時間 | 4,183 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 5 |
| other | AC * 24 |
ソースコード
from collections import defaultdict n = int(input()) a = list(map(int, input().split())) m = 1 M = n - 1 d = defaultdict(list) for i in range(n): d[a[i]].append(i) for i, j in d.items(): if len(j) > 2: print(0) exit(print()) 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)