結果

問題 No.251 大きな桁の復習問題(1)
ユーザー Chihaya_chanChihaya_chan
提出日時 2020-08-11 23:30:43
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 349 bytes
コンパイル時間 128 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-04-17 17:49:38
合計ジャッジ時間 6,906 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

# problem 1
P = 129402307
N = input()
M = input()
N = N[::-1]
mod_N = 0
for i in range(len(N)):
    mod_N += pow(10, i)*int(N[i])
    mod_N %= P
if mod_N == 0:
    print(0)
    exit
else:
    M = M[::-1]
    mod_M = 0
    for i in range(len(M)):
        mod_M += pow(10, i)*int(M[i])
        mod_M %= (P-1)
    print(pow (mod_N, mod_M, P) )
    exit
0