結果
問題 |
No.251 大きな桁の復習問題(1)
|
ユーザー |
![]() |
提出日時 | 2020-12-14 20:42:48 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 96 ms / 5,000 ms |
コード長 | 307 bytes |
コンパイル時間 | 92 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 11,136 KB |
最終ジャッジ日時 | 2024-09-20 00:54:29 |
合計ジャッジ時間 | 2,365 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 |
ソースコード
mod = 129402307 def calc_mod(n, mod): res = 0 for s in n: res *= 10 res += int(s) res %= mod return res N = input() M = input() if M == "0": print(1) exit() N = calc_mod(N, mod) M = calc_mod(M, mod - 1) if N == 0: print(0) else: print(pow(N, M, mod))