結果

問題 No.2011 Arbitrary Mod (Hidden)
ユーザー kiyoshi0205kiyoshi0205
提出日時 2022-07-15 22:41:15
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 608 bytes
コンパイル時間 149 ms
コンパイル使用メモリ 10,956 KB
実行使用メモリ 8,964 KB
最終ジャッジ日時 2023-09-10 03:43:52
合計ジャッジ時間 7,098 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 20 ms
8,908 KB
testcase_01 AC 20 ms
8,940 KB
testcase_02 AC 20 ms
8,752 KB
testcase_03 AC 21 ms
8,904 KB
testcase_04 AC 20 ms
8,844 KB
testcase_05 AC 21 ms
8,784 KB
testcase_06 AC 21 ms
8,748 KB
testcase_07 AC 21 ms
8,768 KB
testcase_08 AC 21 ms
8,912 KB
testcase_09 AC 21 ms
8,892 KB
testcase_10 AC 21 ms
8,912 KB
testcase_11 AC 21 ms
8,892 KB
testcase_12 AC 21 ms
8,908 KB
testcase_13 AC 20 ms
8,768 KB
testcase_14 AC 21 ms
8,808 KB
testcase_15 AC 21 ms
8,848 KB
testcase_16 AC 20 ms
8,772 KB
testcase_17 AC 20 ms
8,912 KB
testcase_18 AC 21 ms
8,756 KB
testcase_19 AC 22 ms
8,808 KB
testcase_20 AC 21 ms
8,776 KB
testcase_21 AC 21 ms
8,768 KB
testcase_22 AC 20 ms
8,956 KB
testcase_23 AC 21 ms
8,916 KB
testcase_24 AC 21 ms
8,812 KB
testcase_25 AC 21 ms
8,912 KB
testcase_26 AC 20 ms
8,748 KB
testcase_27 AC 21 ms
8,920 KB
testcase_28 AC 21 ms
8,752 KB
testcase_29 AC 21 ms
8,804 KB
testcase_30 AC 20 ms
8,752 KB
testcase_31 AC 21 ms
8,964 KB
testcase_32 AC 21 ms
8,868 KB
testcase_33 AC 20 ms
8,852 KB
testcase_34 AC 21 ms
8,900 KB
testcase_35 AC 21 ms
8,740 KB
testcase_36 AC 21 ms
8,812 KB
testcase_37 AC 20 ms
8,848 KB
testcase_38 AC 20 ms
8,812 KB
testcase_39 AC 21 ms
8,820 KB
testcase_40 WA -
testcase_41 WA -
testcase_42 AC 21 ms
8,732 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import random

def is_prime(n):
    if n == 2: return True
    if n == 1 or n & 1 == 0: return False

    d = (n - 1) >> 1
    while d & 1 == 0:
        d >>= 1

    for k in range(100):
        a = random.randint(1, n - 1)
        t = d
        y = pow(a, t, n)

        while t != n - 1 and y != 1 and y != n - 1:
            y = (y * y) % n
            t <<= 1

        if y != n - 1 and t & 1 == 0:
            return False

    return True

if __name__ == '__main__':
    ans=1
    for n in range(60):
        if is_prime(2**(n+1)+1):
            ans=ans*(2**(n+1)+1)

    print(65537*257)
    print(1)
0