結果
問題 | No.251 大きな桁の復習問題(1) |
ユーザー |
|
提出日時 | 2023-05-04 00:13:00 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 154 ms / 5,000 ms |
コード長 | 389 bytes |
コンパイル時間 | 228 ms |
コンパイル使用メモリ | 82,816 KB |
実行使用メモリ | 85,376 KB |
最終ジャッジ日時 | 2024-11-21 22:44:16 |
合計ジャッジ時間 | 3,143 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 |
ソースコード
N = list(map(int, list(input())))M = list(map(int, list(input())))mod = 129402307n = 0d = len(N)for i in range(d):n += N[i] * pow(10, d - i - 1, mod) % modn %= modm = 0dd = len(M)for i in range(dd):m += M[i] * pow(10, dd - i - 1, mod - 1) % (mod - 1)m %= mod - 1if dd == 1 and M[0] == 0:print(1)elif n == 0:print(0)else:print(pow(n, m, mod))