結果
問題 | No.2007 Arbitrary Mod (Easy) |
ユーザー |
![]() |
提出日時 | 2022-07-15 21:40:11 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 40 ms / 2,000 ms |
コード長 | 479 bytes |
コンパイル時間 | 269 ms |
コンパイル使用メモリ | 82,916 KB |
実行使用メモリ | 52,224 KB |
最終ジャッジ日時 | 2024-06-27 17:13:56 |
合計ジャッジ時間 | 4,508 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 30 |
ソースコード
# import numpy as np# import decimal# decimal.getcontext().prec = 100000# a, n = map(decimal.Decimal, input().split())# # m = 10 ** 7# m = 998244353# print(m)# q, r = np.divmod(np.power(a,n), m)# print(r)m = 1000000007# m = 998244353def modpow(a,n,mod):res = 1while n > 0:if n & 1:res = int(res * a % mod)a = int(a * a % mod)n = n >> 1return resa, n = map(int, input().split())print(m)print(modpow(a, n, m))