結果

問題 No.3056 量子コンピュータで素因数分解 Easy
ユーザー 👑 MizarMizar
提出日時 2022-09-28 15:10:39
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 185 ms / 2,000 ms
コード長 183 bytes
コンパイル時間 324 ms
コンパイル使用メモリ 87,252 KB
実行使用メモリ 87,628 KB
平均クエリ数 1.96
最終ジャッジ日時 2023-08-30 06:59:59
合計ジャッジ時間 5,446 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 113 ms
87,520 KB
testcase_01 AC 114 ms
87,336 KB
testcase_02 AC 182 ms
87,396 KB
testcase_03 AC 185 ms
87,088 KB
testcase_04 AC 114 ms
87,520 KB
testcase_05 AC 115 ms
87,616 KB
testcase_06 AC 118 ms
86,972 KB
testcase_07 AC 114 ms
87,352 KB
testcase_08 AC 119 ms
87,276 KB
testcase_09 AC 120 ms
87,048 KB
testcase_10 AC 121 ms
86,976 KB
testcase_11 AC 121 ms
86,956 KB
testcase_12 AC 127 ms
87,236 KB
testcase_13 AC 122 ms
87,300 KB
testcase_14 AC 127 ms
86,980 KB
testcase_15 AC 135 ms
87,008 KB
testcase_16 AC 132 ms
87,360 KB
testcase_17 AC 140 ms
87,628 KB
testcase_18 AC 140 ms
87,584 KB
testcase_19 AC 148 ms
87,316 KB
testcase_20 AC 163 ms
87,356 KB
testcase_21 AC 138 ms
87,516 KB
testcase_22 AC 133 ms
87,172 KB
testcase_23 AC 148 ms
86,896 KB
testcase_24 AC 141 ms
87,408 KB
testcase_25 AC 107 ms
87,464 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math;G=math.gcd;n=int(input());a=2;g=G(n,3)
while g<3:print("?",a);r=int(input());g=max([G(n,pow(a+b,r//(2-(r&1)),n)-1)%n for b in range(10)]+[G(n,a+1)]);a+=1
print("!",g,n//g)
0