結果
問題 |
No.1448 和差算
|
ユーザー |
|
提出日時 | 2021-04-02 19:37:52 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 376 bytes |
コンパイル時間 | 221 ms |
コンパイル使用メモリ | 82,428 KB |
実行使用メモリ | 53,228 KB |
最終ジャッジ日時 | 2024-12-23 15:55:40 |
合計ジャッジ時間 | 3,183 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 30 WA * 6 |
ソースコード
A, B, C, D = map(int, input().split()) N = int(input()) MOD = 10**9+7 p = pow(16, N//8, MOD) if N%8==0: print(p*(B+D)%MOD) elif N%8==1: print((2*p*B)%MOD) elif N%8==2: print(2*p*(B-C)%MOD) elif N%8==3: print(-4*p*C%MOD) elif N%8==4: print(-4*p*(A+C)%MOD) elif N%8==5: print(-8*p*C%MOD) elif N%8==6: print(8*p*(D-A)%MOD) else: print(16*p*D%MOD)