結果

問題 No.251 大きな桁の復習問題(1)
ユーザー brthyyjpbrthyyjp
提出日時 2021-12-27 10:46:03
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 483 bytes
コンパイル時間 1,651 ms
コンパイル使用メモリ 81,388 KB
実行使用メモリ 100,156 KB
最終ジャッジ日時 2023-10-25 09:12:30
合計ジャッジ時間 3,777 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 67 ms
75,092 KB
testcase_01 WA -
testcase_02 AC 66 ms
75,092 KB
testcase_03 AC 67 ms
75,092 KB
testcase_04 AC 67 ms
75,092 KB
testcase_05 AC 67 ms
75,092 KB
testcase_06 AC 67 ms
75,092 KB
testcase_07 AC 67 ms
75,092 KB
testcase_08 AC 67 ms
75,092 KB
testcase_09 AC 85 ms
88,952 KB
testcase_10 AC 96 ms
100,156 KB
testcase_11 AC 95 ms
100,156 KB
testcase_12 AC 96 ms
100,156 KB
testcase_13 AC 96 ms
100,156 KB
testcase_14 AC 96 ms
100,156 KB
testcase_15 AC 97 ms
100,156 KB
testcase_16 AC 97 ms
100,156 KB
testcase_17 AC 97 ms
100,156 KB
testcase_18 AC 96 ms
100,156 KB
testcase_19 AC 96 ms
100,156 KB
testcase_20 AC 68 ms
75,096 KB
testcase_21 AC 67 ms
75,096 KB
testcase_22 AC 67 ms
75,096 KB
testcase_23 AC 67 ms
75,096 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = str(input())
m = str(input())

mod = 129402307

N = 10**6
P0 = [0]*N
P0[0] = 1
for i in range(1, N):
    P0[i] = 10*P0[i-1]
    P0[i] %= mod

P1 = [0]*N
P1[0] = 1
for i in range(1, N):
    P1[i] = 10*P1[i-1]
    P1[i] %= mod-1

n = list(n)
m = list(m)
n.reverse()
m.reverse()
y = 0
for i, c in enumerate(m):
    y += int(c)*P1[i]
    y %= mod-1
x = 0
for i, c in enumerate(n):
    x += int(c)*P0[i]
    x %= mod
if x == 0:
    print(0)
    exit()
ans = pow(x, y, mod)
print(ans)
0