結果

問題 No.3056 量子コンピュータで素因数分解 Easy
ユーザー 👑 MizarMizar
提出日時 2022-10-02 01:45:17
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 109 ms / 2,000 ms
コード長 197 bytes
コンパイル時間 200 ms
コンパイル使用メモリ 10,456 KB
実行使用メモリ 24,716 KB
平均クエリ数 1.92
最終ジャッジ日時 2023-08-30 07:01:45
合計ジャッジ時間 3,598 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 62 ms
24,492 KB
testcase_01 AC 60 ms
24,232 KB
testcase_02 AC 108 ms
24,472 KB
testcase_03 AC 109 ms
24,204 KB
testcase_04 AC 58 ms
24,440 KB
testcase_05 AC 58 ms
24,440 KB
testcase_06 AC 60 ms
23,784 KB
testcase_07 AC 57 ms
23,972 KB
testcase_08 AC 63 ms
23,996 KB
testcase_09 AC 61 ms
23,896 KB
testcase_10 AC 62 ms
24,368 KB
testcase_11 AC 67 ms
24,084 KB
testcase_12 AC 69 ms
23,960 KB
testcase_13 AC 61 ms
24,184 KB
testcase_14 AC 73 ms
24,540 KB
testcase_15 AC 79 ms
24,088 KB
testcase_16 AC 70 ms
24,716 KB
testcase_17 AC 74 ms
24,012 KB
testcase_18 AC 79 ms
24,312 KB
testcase_19 AC 90 ms
24,480 KB
testcase_20 AC 95 ms
24,000 KB
testcase_21 AC 75 ms
24,248 KB
testcase_22 AC 70 ms
23,908 KB
testcase_23 AC 84 ms
24,044 KB
testcase_24 AC 77 ms
24,256 KB
testcase_25 AC 56 ms
23,816 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math;n=int(input());P=lambda p:0 if(g:=math.gcd(p,n)%n)<3 else[print("!",g,n//g),exit()];[[P(a),print("?",a),r:=int(input()),[P(pow(a+b,r>>1-r%2,n)-1)for b in range(99)]]for a in range(3,n)]
0