結果
問題 |
No.8093 Please GCD
|
ユーザー |
![]() |
提出日時 | 2022-04-01 21:44:56 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 539 bytes |
コンパイル時間 | 237 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 28,136 KB |
平均クエリ数 | 1002.40 |
最終ジャッジ日時 | 2024-11-20 08:46:27 |
合計ジャッジ時間 | 10,585 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 15 WA * 15 |
ソースコード
def Question(x): print(f'? {x}') return int(input()) def Answer(x): print(f'! {x}') exit() N = int(input()) S = [] for i in range(2,N+1): flg = True for k in S: if i % k == 0: flg = False break if flg: S.append(i) P = [1] * (N+1) for i in S: if Question(i) >= 2: for j in range(2,N+1): if j % i != 0: P[j] = 0 else: for j in range(i,N+1,i): P[j] = 0 for i in range(N,-1,-1): if P[i]: Answer(i)