結果
問題 | No.2806 Cornflake Man |
ユーザー |
![]() |
提出日時 | 2024-07-15 02:45:43 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 676 bytes |
コンパイル時間 | 376 ms |
コンパイル使用メモリ | 82,308 KB |
実行使用メモリ | 118,756 KB |
最終ジャッジ日時 | 2024-07-15 02:45:52 |
合計ジャッジ時間 | 8,021 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 3 |
other | TLE * 1 -- * 15 |
ソースコード
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 range(1,M+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)