結果

問題 No.3056 量子コンピュータで素因数分解 Easy
ユーザー 👑 MizarMizar
提出日時 2022-10-06 02:59:41
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 170 ms / 2,000 ms
コード長 135 bytes
コンパイル時間 269 ms
コンパイル使用メモリ 10,600 KB
実行使用メモリ 24,384 KB
平均クエリ数 3.04
最終ジャッジ日時 2023-08-30 16:57:25
合計ジャッジ時間 4,337 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 53 ms
24,292 KB
testcase_01 AC 64 ms
24,064 KB
testcase_02 AC 103 ms
24,036 KB
testcase_03 AC 103 ms
23,784 KB
testcase_04 AC 54 ms
23,752 KB
testcase_05 AC 57 ms
23,868 KB
testcase_06 AC 56 ms
24,276 KB
testcase_07 AC 54 ms
23,772 KB
testcase_08 AC 58 ms
23,884 KB
testcase_09 AC 57 ms
23,876 KB
testcase_10 AC 58 ms
24,336 KB
testcase_11 AC 77 ms
24,024 KB
testcase_12 AC 100 ms
24,348 KB
testcase_13 AC 58 ms
24,096 KB
testcase_14 AC 157 ms
24,012 KB
testcase_15 AC 170 ms
24,384 KB
testcase_16 AC 68 ms
24,036 KB
testcase_17 AC 72 ms
23,656 KB
testcase_18 AC 73 ms
23,788 KB
testcase_19 AC 163 ms
23,692 KB
testcase_20 AC 96 ms
23,724 KB
testcase_21 AC 69 ms
23,664 KB
testcase_22 AC 77 ms
23,816 KB
testcase_23 AC 79 ms
24,036 KB
testcase_24 AC 73 ms
24,048 KB
testcase_25 AC 51 ms
23,692 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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