結果

問題 No.3056 量子コンピュータで素因数分解 Easy
ユーザー 👑 MizarMizar
提出日時 2022-09-27 01:15:03
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 118 ms / 2,000 ms
コード長 183 bytes
コンパイル時間 101 ms
コンパイル使用メモリ 10,484 KB
実行使用メモリ 25,048 KB
平均クエリ数 2.42
最終ジャッジ日時 2023-08-30 06:59:42
合計ジャッジ時間 4,051 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 67 ms
24,232 KB
testcase_01 AC 65 ms
24,816 KB
testcase_02 AC 110 ms
24,552 KB
testcase_03 AC 111 ms
24,876 KB
testcase_04 AC 61 ms
24,196 KB
testcase_05 AC 63 ms
24,460 KB
testcase_06 AC 64 ms
24,304 KB
testcase_07 AC 61 ms
24,800 KB
testcase_08 AC 66 ms
24,356 KB
testcase_09 AC 64 ms
24,380 KB
testcase_10 AC 65 ms
24,596 KB
testcase_11 AC 75 ms
24,388 KB
testcase_12 AC 117 ms
24,480 KB
testcase_13 AC 68 ms
25,048 KB
testcase_14 AC 84 ms
24,312 KB
testcase_15 AC 104 ms
24,548 KB
testcase_16 AC 74 ms
24,984 KB
testcase_17 AC 78 ms
24,756 KB
testcase_18 AC 79 ms
24,500 KB
testcase_19 AC 118 ms
24,708 KB
testcase_20 AC 101 ms
24,132 KB
testcase_21 AC 77 ms
24,848 KB
testcase_22 AC 93 ms
24,648 KB
testcase_23 AC 87 ms
24,292 KB
testcase_24 AC 82 ms
24,316 KB
testcase_25 AC 58 ms
24,908 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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