結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 60 ms
24,028 KB
testcase_01 AC 61 ms
23,648 KB
testcase_02 AC 141 ms
23,856 KB
testcase_03 AC 143 ms
23,964 KB
testcase_04 AC 60 ms
23,640 KB
testcase_05 AC 62 ms
24,252 KB
testcase_06 AC 66 ms
23,696 KB
testcase_07 AC 64 ms
24,068 KB
testcase_08 AC 66 ms
23,968 KB
testcase_09 AC 67 ms
23,832 KB
testcase_10 AC 69 ms
24,292 KB
testcase_11 AC 68 ms
24,264 KB
testcase_12 AC 74 ms
23,760 KB
testcase_13 AC 68 ms
23,852 KB
testcase_14 AC 92 ms
24,012 KB
testcase_15 AC 84 ms
23,992 KB
testcase_16 AC 82 ms
24,048 KB
testcase_17 AC 89 ms
24,104 KB
testcase_18 AC 90 ms
23,472 KB
testcase_19 AC 98 ms
23,568 KB
testcase_20 AC 113 ms
23,648 KB
testcase_21 AC 81 ms
24,324 KB
testcase_22 AC 79 ms
24,252 KB
testcase_23 AC 101 ms
23,708 KB
testcase_24 AC 96 ms
24,076 KB
testcase_25 AC 56 ms
23,716 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math;G=math.gcd;a=g=2;n=int(input())
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