結果

問題 No.251 大きな桁の復習問題(1)
ユーザー nebukuro09nebukuro09
提出日時 2016-10-16 14:11:07
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 238 bytes
コンパイル時間 120 ms
コンパイル使用メモリ 6,912 KB
実行使用メモリ 6,784 KB
最終ジャッジ日時 2024-05-02 02:20:37
合計ジャッジ時間 2,293 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 9 ms
6,272 KB
testcase_01 AC 9 ms
6,144 KB
testcase_02 AC 10 ms
6,400 KB
testcase_03 AC 9 ms
6,400 KB
testcase_04 WA -
testcase_05 AC 9 ms
6,272 KB
testcase_06 WA -
testcase_07 AC 10 ms
6,144 KB
testcase_08 AC 10 ms
6,144 KB
testcase_09 AC 134 ms
6,656 KB
testcase_10 AC 128 ms
6,656 KB
testcase_11 AC 131 ms
6,784 KB
testcase_12 AC 129 ms
6,784 KB
testcase_13 AC 128 ms
6,656 KB
testcase_14 AC 129 ms
6,784 KB
testcase_15 AC 131 ms
6,784 KB
testcase_16 AC 131 ms
6,784 KB
testcase_17 AC 130 ms
6,784 KB
testcase_18 AC 130 ms
6,656 KB
testcase_19 AC 141 ms
6,784 KB
testcase_20 AC 10 ms
6,400 KB
testcase_21 AC 10 ms
6,144 KB
testcase_22 AC 9 ms
6,144 KB
testcase_23 AC 9 ms
6,144 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def powermod(n, x, mod):
    ans = 1
    while x >= 1:
        if x%2:
            ans = ans * n % mod
        n = n * n % mod
        x /= 2
    return ans

MOD = 129402307
print powermod(int(raw_input()), int(raw_input())%(MOD-1), MOD)
0