結果

問題 No.3056 量子コンピュータで素因数分解 Easy
ユーザー ecotteaecottea
提出日時 2022-10-19 01:48:22
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 163 bytes
コンパイル時間 168 ms
コンパイル使用メモリ 10,612 KB
実行使用メモリ 24,388 KB
平均クエリ数 2.00
最終ジャッジ日時 2023-09-11 17:14:56
合計ジャッジ時間 4,924 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 104 ms
23,620 KB
testcase_03 AC 104 ms
23,640 KB
testcase_04 AC 56 ms
23,572 KB
testcase_05 AC 58 ms
23,728 KB
testcase_06 AC 59 ms
23,760 KB
testcase_07 AC 56 ms
24,064 KB
testcase_08 AC 62 ms
23,652 KB
testcase_09 AC 61 ms
24,384 KB
testcase_10 AC 60 ms
24,300 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 59 ms
24,072 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 68 ms
24,372 KB
testcase_17 AC 72 ms
23,572 KB
testcase_18 AC 73 ms
23,616 KB
testcase_19 WA -
testcase_20 AC 94 ms
23,636 KB
testcase_21 AC 74 ms
23,516 KB
testcase_22 WA -
testcase_23 AC 83 ms
23,624 KB
testcase_24 AC 77 ms
24,204 KB
testcase_25 AC 53 ms
24,140 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math

n = int(input())

print("? 2")

r = int(input())

pow2 = pow(2, r // 2, mod=n)

p = math.gcd(pow2 + 1, n)
q = math.gcd(pow2 - 1, n)

print("!", p, q)
0