結果
問題 |
No.8093 Please GCD
|
ユーザー |
![]() |
提出日時 | 2022-04-01 21:48:16 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 581 bytes |
コンパイル時間 | 148 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 28,016 KB |
平均クエリ数 | 1004.17 |
最終ジャッジ日時 | 2024-11-20 08:52:55 |
合計ジャッジ時間 | 9,973 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 16 WA * 14 |
ソースコード
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]: if Question(i) == i: Answer(i) Answer(1)