結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 63 ms
23,796 KB
testcase_01 AC 68 ms
23,696 KB
testcase_02 AC 107 ms
23,752 KB
testcase_03 AC 107 ms
23,572 KB
testcase_04 AC 63 ms
24,152 KB
testcase_05 AC 62 ms
23,664 KB
testcase_06 AC 63 ms
23,696 KB
testcase_07 AC 60 ms
23,720 KB
testcase_08 AC 64 ms
23,456 KB
testcase_09 AC 64 ms
23,840 KB
testcase_10 AC 64 ms
23,832 KB
testcase_11 AC 84 ms
23,588 KB
testcase_12 AC 105 ms
23,644 KB
testcase_13 AC 64 ms
24,336 KB
testcase_14 AC 164 ms
24,012 KB
testcase_15 AC 175 ms
23,716 KB
testcase_16 AC 72 ms
23,984 KB
testcase_17 AC 75 ms
23,684 KB
testcase_18 AC 75 ms
24,108 KB
testcase_19 AC 164 ms
24,000 KB
testcase_20 AC 97 ms
23,760 KB
testcase_21 AC 73 ms
24,336 KB
testcase_22 AC 84 ms
24,024 KB
testcase_23 AC 84 ms
24,016 KB
testcase_24 AC 78 ms
24,312 KB
testcase_25 AC 55 ms
23,640 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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