結果

問題 No.251 大きな桁の復習問題(1)
ユーザー BantakoBantako
提出日時 2018-12-25 21:06:12
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
(最新)
AC  
(最初)
実行時間 -
コード長 313 bytes
コンパイル時間 94 ms
コンパイル使用メモリ 11,904 KB
実行使用メモリ 10,240 KB
最終ジャッジ日時 2024-04-08 22:40:03
合計ジャッジ時間 1,646 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
9,984 KB
testcase_01 AC 27 ms
9,984 KB
testcase_02 AC 26 ms
9,984 KB
testcase_03 AC 31 ms
9,984 KB
testcase_04 AC 30 ms
9,984 KB
testcase_05 AC 27 ms
9,984 KB
testcase_06 AC 27 ms
9,984 KB
testcase_07 AC 27 ms
9,984 KB
testcase_08 AC 26 ms
9,984 KB
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 AC 27 ms
9,984 KB
testcase_21 AC 27 ms
9,984 KB
testcase_22 AC 28 ms
9,984 KB
testcase_23 AC 28 ms
9,984 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def powmod(x, n, p):
    if x == 0:
        return 0
    if n == 0:
        return 1
    ans = powmod(x * x % p, n // 2, p)
    if(n % 2 == 1):
        ans = ans * x % p
    return ans
N = int(input() )
M = int(input() )
m = 129402307
if M == 0:
    print(1)
else:
    print( powmod( (N % m),  (M % (m-1) ), m) )
0