結果
| 問題 |
No.2806 Cornflake Man
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-07-12 21:25:59 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 202 ms / 2,000 ms |
| コード長 | 319 bytes |
| コンパイル時間 | 169 ms |
| コンパイル使用メモリ | 82,220 KB |
| 実行使用メモリ | 184,624 KB |
| 最終ジャッジ日時 | 2024-07-17 20:25:38 |
| 合計ジャッジ時間 | 3,206 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 17 |
ソースコード
n, m = map(int, input().split())
A = list(map(int, input().split()))
A.sort()
se = set(A)
se2 = set()
B = []
for a in A[1:]:
if a in se2:
continue
for b in range(a, m + 1, a):
if b not in se:
print(-1)
exit()
se2.add(b)
B.append(a)
print(len(B))
print(*B)