結果

問題 No.2007 Arbitrary Mod (Easy)
ユーザー dangodango
提出日時 2023-06-02 21:38:42
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 248 bytes
コンパイル時間 1,228 ms
コンパイル使用メモリ 12,288 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-12-28 16:51:15
合計ジャッジ時間 4,516 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 3
other WA * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

def mod_pow(a, b, c):
    result = 1
    while b > 0:
        if b % 2 == 1:
            result = (result * a) % c
        a = (a * a) % c
        b //= 2
    return result
a,n=map(int,input().split())
print(mod_pow(a,n,998244353))
print(998244353)
0