結果
問題 | No.3093 Please GCD |
ユーザー | nasubi24 |
提出日時 | 2022-04-01 22:37:21 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 574 bytes |
コンパイル時間 | 312 ms |
コンパイル使用メモリ | 82,472 KB |
実行使用メモリ | 94,352 KB |
平均クエリ数 | 8095.83 |
最終ジャッジ日時 | 2024-04-30 14:53:47 |
合計ジャッジ時間 | 17,884 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 52 ms
69,920 KB |
testcase_01 | AC | 53 ms
76,144 KB |
testcase_02 | AC | 120 ms
88,172 KB |
testcase_03 | WA | - |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | AC | 566 ms
93,252 KB |
testcase_08 | WA | - |
testcase_09 | AC | 527 ms
94,120 KB |
testcase_10 | AC | 50 ms
69,420 KB |
testcase_11 | WA | - |
testcase_12 | WA | - |
testcase_13 | AC | 542 ms
93,620 KB |
testcase_14 | AC | 565 ms
93,640 KB |
testcase_15 | AC | 120 ms
86,840 KB |
testcase_16 | WA | - |
testcase_17 | AC | 553 ms
93,640 KB |
testcase_18 | WA | - |
testcase_19 | WA | - |
testcase_20 | WA | - |
testcase_21 | WA | - |
testcase_22 | WA | - |
testcase_23 | WA | - |
testcase_24 | AC | 504 ms
93,512 KB |
testcase_25 | AC | 509 ms
93,484 KB |
testcase_26 | WA | - |
testcase_27 | WA | - |
testcase_28 | WA | - |
testcase_29 | WA | - |
ソースコード
import math n=int(input()) p=[] for i in range(2,n+1): for j in range(2,i): if i%j==0: break else: p.append(i) now=0 num=1 num2=1 cnt=0 while now!=len(p) and (n//num)+cnt<=620: tem=1 while now!=len(p): if tem*p[now]>n: break tem*=p[now] now+=1 cnt+=1 print("?",tem,flush=True) k=int(input()) num*=k num2*=tem//k ans=num for i in range(2,(n//num)+1): if math.gcd(num2,i)==1: print("?",num*i,flush=True) ans=max(ans,int(input())) print("!",ans,flush=True)