結果

問題 No.1448 和差算
ユーザー 👑 H20H20
提出日時 2021-04-20 13:21:38
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 300 bytes
コンパイル時間 281 ms
コンパイル使用メモリ 87,228 KB
実行使用メモリ 71,684 KB
最終ジャッジ日時 2023-09-17 08:40:23
合計ジャッジ時間 4,576 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,568 KB
testcase_01 AC 73 ms
71,460 KB
testcase_02 AC 74 ms
71,380 KB
testcase_03 AC 74 ms
71,468 KB
testcase_04 AC 73 ms
71,180 KB
testcase_05 AC 72 ms
71,408 KB
testcase_06 AC 73 ms
71,364 KB
testcase_07 AC 72 ms
71,584 KB
testcase_08 AC 73 ms
71,524 KB
testcase_09 WA -
testcase_10 AC 72 ms
71,460 KB
testcase_11 AC 72 ms
71,396 KB
testcase_12 AC 73 ms
71,456 KB
testcase_13 AC 72 ms
71,684 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 72 ms
71,476 KB
testcase_18 WA -
testcase_19 AC 74 ms
71,196 KB
testcase_20 AC 73 ms
71,436 KB
testcase_21 AC 73 ms
71,320 KB
testcase_22 AC 71 ms
71,428 KB
testcase_23 AC 72 ms
71,404 KB
testcase_24 AC 74 ms
71,504 KB
testcase_25 AC 72 ms
71,432 KB
testcase_26 AC 73 ms
71,452 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 71 ms
71,588 KB
testcase_31 AC 73 ms
71,232 KB
testcase_32 AC 73 ms
71,480 KB
testcase_33 WA -
testcase_34 AC 74 ms
71,192 KB
testcase_35 AC 72 ms
71,176 KB
testcase_36 AC 74 ms
71,528 KB
testcase_37 AC 72 ms
71,480 KB
testcase_38 AC 73 ms
71,396 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

MOD = 10**9+7
A,B,C,D = map(int,input().split())
N = int(input())
if N%8>=4:
    A,B,C,D = -B,-A,-D,-C
if N%4==0:
    print((B+D)*pow(4,N//4,MOD)%MOD)
elif N%4==1:
    print((2*B)*pow(4,N//4,MOD)%MOD)
elif N%4==2:
    print(2*(B-C)*pow(4,N//4,MOD)%MOD)
elif N%4==3:
    print(4*C*pow(4,N//4,MOD)%MOD)
0