結果

問題 No.976 2 の 128 乗と M
ユーザー tachyon777tachyon777
提出日時 2020-02-13 12:15:06
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 41 ms / 2,000 ms
コード長 263 bytes
コンパイル時間 179 ms
コンパイル使用メモリ 82,636 KB
実行使用メモリ 53,744 KB
最終ジャッジ日時 2024-04-15 14:54:32
合計ジャッジ時間 4,007 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
52,816 KB
testcase_01 AC 39 ms
52,660 KB
testcase_02 AC 40 ms
52,000 KB
testcase_03 AC 40 ms
52,280 KB
testcase_04 AC 39 ms
51,808 KB
testcase_05 AC 40 ms
53,008 KB
testcase_06 AC 39 ms
52,252 KB
testcase_07 AC 39 ms
52,756 KB
testcase_08 AC 39 ms
52,580 KB
testcase_09 AC 40 ms
52,380 KB
testcase_10 AC 41 ms
52,916 KB
testcase_11 AC 39 ms
52,304 KB
testcase_12 AC 39 ms
52,608 KB
testcase_13 AC 39 ms
52,960 KB
testcase_14 AC 39 ms
51,976 KB
testcase_15 AC 40 ms
52,220 KB
testcase_16 AC 37 ms
52,972 KB
testcase_17 AC 39 ms
52,300 KB
testcase_18 AC 39 ms
52,144 KB
testcase_19 AC 39 ms
53,180 KB
testcase_20 AC 40 ms
52,076 KB
testcase_21 AC 40 ms
53,020 KB
testcase_22 AC 39 ms
52,992 KB
testcase_23 AC 40 ms
53,744 KB
testcase_24 AC 39 ms
53,500 KB
testcase_25 AC 39 ms
52,896 KB
testcase_26 AC 39 ms
52,988 KB
testcase_27 AC 40 ms
52,824 KB
testcase_28 AC 40 ms
52,072 KB
testcase_29 AC 41 ms
52,320 KB
testcase_30 AC 40 ms
52,060 KB
testcase_31 AC 39 ms
53,592 KB
testcase_32 AC 39 ms
53,272 KB
testcase_33 AC 40 ms
52,680 KB
testcase_34 AC 40 ms
52,832 KB
testcase_35 AC 39 ms
52,596 KB
testcase_36 AC 39 ms
53,016 KB
testcase_37 AC 40 ms
52,360 KB
testcase_38 AC 39 ms
52,744 KB
testcase_39 AC 39 ms
51,944 KB
testcase_40 AC 39 ms
52,536 KB
testcase_41 AC 40 ms
53,588 KB
testcase_42 AC 40 ms
52,628 KB
testcase_43 AC 39 ms
52,824 KB
testcase_44 AC 40 ms
52,896 KB
testcase_45 AC 39 ms
52,444 KB
testcase_46 AC 41 ms
52,588 KB
testcase_47 AC 40 ms
52,616 KB
testcase_48 AC 40 ms
52,152 KB
testcase_49 AC 38 ms
52,840 KB
testcase_50 AC 40 ms
51,872 KB
testcase_51 AC 40 ms
52,840 KB
testcase_52 AC 39 ms
52,328 KB
testcase_53 AC 39 ms
52,404 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = int(input())

def pow(n, p): #繰り返し二乗法
    res = 1
    while p > 0:
        if p % 2 == 0:
            n = n ** 2 % mod
            p //= 2
        else:
            res = res * n % mod
            p -= 1
    return res % mod

print(pow(2,128))
0