結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 61 ms
24,360 KB
testcase_01 AC 63 ms
23,652 KB
testcase_02 AC 147 ms
23,636 KB
testcase_03 AC 149 ms
23,660 KB
testcase_04 AC 62 ms
23,764 KB
testcase_05 AC 64 ms
24,408 KB
testcase_06 AC 68 ms
24,012 KB
testcase_07 AC 65 ms
24,024 KB
testcase_08 AC 68 ms
23,664 KB
testcase_09 AC 71 ms
23,664 KB
testcase_10 AC 69 ms
23,648 KB
testcase_11 AC 68 ms
23,728 KB
testcase_12 AC 74 ms
23,516 KB
testcase_13 AC 70 ms
24,324 KB
testcase_14 AC 94 ms
24,088 KB
testcase_15 AC 85 ms
23,592 KB
testcase_16 AC 85 ms
23,520 KB
testcase_17 AC 89 ms
23,576 KB
testcase_18 AC 89 ms
23,716 KB
testcase_19 AC 99 ms
23,720 KB
testcase_20 AC 115 ms
24,252 KB
testcase_21 AC 82 ms
23,600 KB
testcase_22 AC 82 ms
23,692 KB
testcase_23 AC 99 ms
23,576 KB
testcase_24 AC 96 ms
23,856 KB
testcase_25 AC 55 ms
24,324 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math;G=math.gcd;n=int(input());a=2;g=G(n,3)
while g<3:print("?",a);r=int(input());g=max([G(n,pow(a+b,r//(2-(r&1)),n)-1)%n for b in range(9)]+[G(n,a+1)]);a+=1
print("!",g,n//g)
0