結果
問題 | 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 sys input = sys.stdin.readline N,M=map(int,input().split()) A=list(map(int,input().split())) USED=set() ko=0 SET=set(A) ANS=[] for i in sorted(A)[1:]: if M//i>N: continue flag=1 for j in range(10**9+1): if i*j>M: break if i*j in SET: if i*j in USED: pass else: flag+=1 else: flag=0 break if flag>1: ANS.append(i) for j in range(10**9+1): if i*j>M: break USED.add(i*j) if len(USED)==len(SET): print(len(ANS)) print(*ANS) exit() print(-1)