結果
| 問題 |
No.8093 Please GCD
|
| コンテスト | |
| ユーザー |
tnodino
|
| 提出日時 | 2022-04-01 21:47:21 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 572 bytes |
| コンパイル時間 | 96 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 28,152 KB |
| 平均クエリ数 | 1005.10 |
| 最終ジャッジ日時 | 2024-11-20 08:51:00 |
| 合計ジャッジ時間 | 11,550 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 6 RE * 24 |
ソースコード
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)
tnodino