結果

問題 No.251 大きな桁の復習問題(1)
ユーザー tktk_snsntktk_snsn
提出日時 2020-12-14 20:38:24
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 268 bytes
コンパイル時間 104 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 11,008 KB
最終ジャッジ日時 2024-09-20 00:54:18
合計ジャッジ時間 2,163 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 129402307


def calc_mod(n, mod):
    res = 0
    for s in n:
        res *= 10
        res += int(s)
        res %= mod
    return res


N = calc_mod(input(), mod)
M = calc_mod(input(), mod - 1)
if N == 0 and M == 0:
    print(0)
else:
    print(pow(N, M, mod))
0