結果
問題 |
No.1448 和差算
|
ユーザー |
![]() |
提出日時 | 2021-04-02 18:07:01 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 32 ms / 2,000 ms |
コード長 | 227 bytes |
コンパイル時間 | 301 ms |
コンパイル使用メモリ | 12,288 KB |
実行使用メモリ | 10,624 KB |
最終ジャッジ日時 | 2024-12-23 14:24:41 |
合計ジャッジ時間 | 2,598 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 36 |
ソースコード
a, b, c, d = map(int, input().split()) n = int(input()) mod = int(1e9+7) x, y = -a, d if n%8<=3: x = b if 2<=n%8<=5: y = -c if n%8 in (3,7): x = 0 if n%8 in (1,5): y = 0 ans = (x + y) * pow(2, (n+1)//2, mod) % mod print(ans)