結果
問題 | No.2806 Cornflake Man |
ユーザー |
![]() |
提出日時 | 2024-07-15 02:48:27 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 317 ms / 2,000 ms |
コード長 | 677 bytes |
コンパイル時間 | 157 ms |
コンパイル使用メモリ | 82,136 KB |
実行使用メモリ | 166,800 KB |
最終ジャッジ日時 | 2024-07-17 20:28:18 |
合計ジャッジ時間 | 3,838 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 17 |
ソースコード
import sysinput = sys.stdin.readlineN,M=map(int,input().split())A=list(map(int,input().split()))USED=set()ko=0SET=set(A)ANS=[]for i in sorted(A)[1:]:if M//i>N:continueflag=1for j in range(10**9+1):if i*j>M:breakif i*j in SET:if i*j in USED:passelse:flag+=1else:flag=0breakif flag>1:ANS.append(i)for j in range(10**9+1):if i*j>M:breakUSED.add(i*j)if len(USED)==len(SET):print(len(ANS))print(*ANS)exit()print(-1)