結果

問題 No.251 大きな桁の復習問題(1)
ユーザー lloyzlloyz
提出日時 2023-05-04 00:13:00
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 145 ms / 5,000 ms
コード長 389 bytes
コンパイル時間 183 ms
コンパイル使用メモリ 82,000 KB
実行使用メモリ 86,744 KB
最終ジャッジ日時 2024-05-01 17:22:52
合計ジャッジ時間 3,233 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
53,340 KB
testcase_01 AC 40 ms
52,024 KB
testcase_02 AC 41 ms
52,004 KB
testcase_03 AC 39 ms
53,160 KB
testcase_04 AC 36 ms
52,072 KB
testcase_05 AC 35 ms
52,560 KB
testcase_06 AC 36 ms
52,980 KB
testcase_07 AC 36 ms
52,336 KB
testcase_08 AC 36 ms
52,512 KB
testcase_09 AC 141 ms
85,544 KB
testcase_10 AC 142 ms
85,652 KB
testcase_11 AC 142 ms
85,848 KB
testcase_12 AC 143 ms
86,044 KB
testcase_13 AC 142 ms
85,500 KB
testcase_14 AC 141 ms
86,744 KB
testcase_15 AC 141 ms
85,800 KB
testcase_16 AC 142 ms
86,288 KB
testcase_17 AC 140 ms
86,024 KB
testcase_18 AC 140 ms
85,832 KB
testcase_19 AC 145 ms
86,424 KB
testcase_20 AC 36 ms
52,392 KB
testcase_21 AC 36 ms
52,056 KB
testcase_22 AC 35 ms
52,140 KB
testcase_23 AC 36 ms
52,992 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = list(map(int, list(input())))
M = list(map(int, list(input())))
mod = 129402307

n = 0
d = len(N)
for i in range(d):
    n += N[i] * pow(10, d - i - 1, mod) % mod
    n %= mod
m = 0
dd = len(M)
for i in range(dd):
    m += M[i] * pow(10, dd - i - 1, mod - 1) % (mod - 1)
    m %= mod - 1
if dd == 1 and M[0] == 0:
    print(1)
elif n == 0:
    print(0)
else:
    print(pow(n, m, mod))
0