結果
| 問題 | No.2806 Cornflake Man |
| コンテスト | |
| ユーザー |
detteiuu
|
| 提出日時 | 2024-07-12 21:51:23 |
| 言語 | PyPy3 (8.0.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 125 ms / 2,000 ms |
| + 461µs | |
| コード長 | 405 bytes |
| 記録 | |
| コンパイル時間 | 80 ms |
| コンパイル使用メモリ | 64,656 KB |
| 実行使用メモリ | 96,784 KB |
| 最終ジャッジ日時 | 2026-10-17 13:38:21 |
| 合計ジャッジ時間 | 4,248 ms |
|
ジャッジサーバーID (参考情報) |
judge4_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 18 |
ソースコード
N, M = map(int, input().split())
A = sorted(list(map(int, input().split())))
S = set(A[1:])
used = set()
ans = []
for i in range(1, N):
if A[i] not in S:
continue
ans.append(A[i])
for j in range(A[i], M+1, A[i]):
if j not in S and j not in used:
exit(print(-1))
if j not in used:
S.remove(j)
used.add(j)
print(len(ans))
print(*ans)
detteiuu