結果

問題 No.403 2^2^2
コンテスト
ユーザー koheijkt
提出日時 2025-12-20 15:07:55
言語 PyPy3
(8.0.0 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 35 ms / 2,000 ms
+ 947µs
コード長 215 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 91 ms
コンパイル使用メモリ 64,488 KB
実行使用メモリ 53,840 KB
最終ジャッジ日時 2026-10-15 04:04:48
合計ジャッジ時間 3,186 ms
ジャッジサーバーID
(参考情報)
judge5_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 28
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

M = 10**9+7
A, B, C = input().split('^')
A, B, C = int(A), int(B), int(C)
A %= M

if A == 0:
    exit(print(0, 0))

x = pow(A, B, M)
ans1 = pow(x, C, M)

x = pow(B, C, M - 1)

ans2 = pow(A, x, M)

print(ans1, ans2)
0