結果

問題 No.3056 量子コンピュータで素因数分解 Easy
ユーザー 👑 MizarMizar
提出日時 2022-09-09 02:34:05
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 174 ms / 2,000 ms
コード長 156 bytes
コンパイル時間 168 ms
コンパイル使用メモリ 10,576 KB
実行使用メモリ 24,264 KB
平均クエリ数 3.04
最終ジャッジ日時 2023-08-30 06:58:34
合計ジャッジ時間 4,058 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 62 ms
24,012 KB
testcase_01 AC 66 ms
23,540 KB
testcase_02 AC 110 ms
24,136 KB
testcase_03 AC 108 ms
23,916 KB
testcase_04 AC 61 ms
23,980 KB
testcase_05 AC 62 ms
23,808 KB
testcase_06 AC 62 ms
23,540 KB
testcase_07 AC 61 ms
23,964 KB
testcase_08 AC 64 ms
23,984 KB
testcase_09 AC 64 ms
23,624 KB
testcase_10 AC 65 ms
23,776 KB
testcase_11 AC 84 ms
24,144 KB
testcase_12 AC 105 ms
24,088 KB
testcase_13 AC 64 ms
23,532 KB
testcase_14 AC 163 ms
23,684 KB
testcase_15 AC 174 ms
23,560 KB
testcase_16 AC 75 ms
24,036 KB
testcase_17 AC 77 ms
23,688 KB
testcase_18 AC 77 ms
24,240 KB
testcase_19 AC 165 ms
23,392 KB
testcase_20 AC 99 ms
23,552 KB
testcase_21 AC 76 ms
23,980 KB
testcase_22 AC 84 ms
24,096 KB
testcase_23 AC 87 ms
23,776 KB
testcase_24 AC 81 ms
24,264 KB
testcase_25 AC 56 ms
24,144 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math;G=math.gcd;a=g=2;n=int(input())
while g<3:print("?",a);r=int(input());t=pow(a,r//2,n);a+=1;g=max(G(n,t-1)%n,G(n,t+1)%n,G(n,a))
print("!",g,n//g)
0