結果

問題 No.1448 和差算
ユーザー roarisroaris
提出日時 2021-04-02 19:39:37
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 376 bytes
コンパイル時間 284 ms
コンパイル使用メモリ 86,996 KB
実行使用メモリ 71,664 KB
最終ジャッジ日時 2023-08-25 03:48:23
合計ジャッジ時間 4,726 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 70 ms
71,152 KB
testcase_04 AC 69 ms
71,556 KB
testcase_05 AC 68 ms
71,300 KB
testcase_06 AC 69 ms
71,300 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 70 ms
71,572 KB
testcase_10 WA -
testcase_11 AC 71 ms
71,100 KB
testcase_12 AC 69 ms
71,424 KB
testcase_13 AC 69 ms
71,108 KB
testcase_14 AC 71 ms
71,380 KB
testcase_15 AC 70 ms
71,256 KB
testcase_16 AC 68 ms
71,252 KB
testcase_17 AC 69 ms
71,336 KB
testcase_18 AC 69 ms
71,260 KB
testcase_19 AC 71 ms
71,352 KB
testcase_20 AC 69 ms
71,308 KB
testcase_21 AC 69 ms
71,420 KB
testcase_22 AC 70 ms
71,368 KB
testcase_23 AC 71 ms
71,484 KB
testcase_24 AC 70 ms
71,520 KB
testcase_25 AC 70 ms
71,572 KB
testcase_26 AC 69 ms
71,252 KB
testcase_27 AC 68 ms
71,148 KB
testcase_28 AC 69 ms
71,304 KB
testcase_29 AC 69 ms
71,328 KB
testcase_30 AC 70 ms
71,088 KB
testcase_31 AC 70 ms
71,356 KB
testcase_32 AC 71 ms
71,424 KB
testcase_33 AC 70 ms
71,240 KB
testcase_34 AC 70 ms
71,256 KB
testcase_35 AC 69 ms
71,424 KB
testcase_36 AC 70 ms
71,248 KB
testcase_37 AC 70 ms
71,488 KB
testcase_38 AC 71 ms
71,252 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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*B%MOD)
elif N%8==6:
    print(8*p*(D-A)%MOD)
else:
    print(16*p*D%MOD)
0