結果

問題 No.403 2^2^2
ユーザー jupiro
提出日時 2020-04-15 20:19:08
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 38 ms / 2,000 ms
コード長 214 bytes
コンパイル時間 170 ms
コンパイル使用メモリ 81,536 KB
実行使用メモリ 51,968 KB
最終ジャッジ日時 2024-10-01 19:01:28
合計ジャッジ時間 2,069 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

a,b,c = map(int,input().split('^'))

mod = 1000000007

if a % mod == 0:
    print("0 0")
    exit()

res1 = pow(pow(a,b,mod),c,mod)

cnt = pow(b,c, mod - 1)

res2 = pow(a,cnt,mod)

print(str(res1) + " "+str(res2))
0