結果
問題 | No.1448 和差算 |
ユーザー |
![]() |
提出日時 | 2021-03-31 16:23:30 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 39 ms / 2,000 ms |
コード長 | 460 bytes |
コンパイル時間 | 373 ms |
コンパイル使用メモリ | 82,468 KB |
実行使用メモリ | 54,036 KB |
最終ジャッジ日時 | 2024-12-15 03:33:51 |
合計ジャッジ時間 | 3,404 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 36 |
ソースコード
mod = 1000000007eps = 10**-9def main():import sysinput = sys.stdin.readlinea, b, c, d = map(int, input().split())N = int(input())x = y = pow(2, (N+1) // 2, mod)if 0 <= N%8 < 3:x *= belif 4 <= N%8 < 7:x *= -aelse:x = 0if N%8 == 0 or 6 <= N%8:y *= delif 2 <= N%8 <= 4:y *= -celse:y = 0print((x + y)%mod)if __name__ == '__main__':main()