結果

問題 No.403 2^2^2
ユーザー
提出日時 2016-11-12 19:56:32
言語 Python2
(2.7.18)
結果
AC  
実行時間 12 ms / 2,000 ms
コード長 206 bytes
コンパイル時間 53 ms
コンパイル使用メモリ 6,944 KB
実行使用メモリ 6,528 KB
最終ジャッジ日時 2024-11-25 21:33:09
合計ジャッジ時間 1,326 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

a, b, c = map(eval, raw_input().strip().split("^"))
MOD = 10**9 + 7

# from fermat's little theorem
x = pow(a, b * c, MOD)
bpc = pow(b, c, MOD-1)
if bpc == 0:
 y = 0
else:
 y = pow(a, bpc, MOD)

print x, y
0