結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 60 ms
23,816 KB
testcase_01 AC 65 ms
24,060 KB
testcase_02 AC 108 ms
23,648 KB
testcase_03 AC 107 ms
24,420 KB
testcase_04 AC 58 ms
23,868 KB
testcase_05 AC 59 ms
23,984 KB
testcase_06 AC 59 ms
24,336 KB
testcase_07 AC 58 ms
24,060 KB
testcase_08 AC 64 ms
24,108 KB
testcase_09 AC 62 ms
24,036 KB
testcase_10 AC 63 ms
24,360 KB
testcase_11 AC 82 ms
23,572 KB
testcase_12 AC 106 ms
23,748 KB
testcase_13 AC 64 ms
24,288 KB
testcase_14 AC 159 ms
23,492 KB
testcase_15 AC 173 ms
23,460 KB
testcase_16 AC 71 ms
24,060 KB
testcase_17 AC 74 ms
23,772 KB
testcase_18 AC 76 ms
23,944 KB
testcase_19 AC 162 ms
24,060 KB
testcase_20 AC 96 ms
23,576 KB
testcase_21 AC 75 ms
24,420 KB
testcase_22 AC 85 ms
24,072 KB
testcase_23 AC 84 ms
24,036 KB
testcase_24 AC 79 ms
23,640 KB
testcase_25 AC 56 ms
24,432 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# yukicoder@python3
import math;G=math.gcd;a=g=2;n=int(input())
while g<3:print("?",a);g=max(G(n,pow(a,int(input())>>1,n)-1),G(a:=a+1,n))
print("!",g,n//g)
0