結果

問題 No.1578 A × B × C
ユーザー uiromochi
提出日時 2021-07-02 22:22:40
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 30 ms / 2,000 ms
コード長 336 bytes
コンパイル時間 133 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-06-29 12:03:00
合計ジャッジ時間 1,764 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline  # "\n"を含む

def solve(A, B, C, K):

    mod = 10 ** 9 + 7

    P = (A * B * C) % mod
    K = pow(2, K, mod-1)

    return pow(P, K, mod)

def main():
    A, B, C = map(int, input().split())
    K = int(input())
    res = solve(A, B, C, K)
    print(res)

if __name__ == "__main__":
    main()
0