結果

問題 No.2196 Pair Bonus
ユーザー ShirotsumeShirotsume
提出日時 2022-02-13 11:11:03
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 278 ms / 2,000 ms
コード長 409 bytes
コンパイル時間 148 ms
コンパイル使用メモリ 10,872 KB
実行使用メモリ 39,892 KB
最終ジャッジ日時 2023-09-11 15:21:34
合計ジャッジ時間 4,440 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,904 KB
testcase_01 AC 16 ms
7,864 KB
testcase_02 AC 16 ms
7,784 KB
testcase_03 AC 278 ms
39,748 KB
testcase_04 AC 277 ms
39,892 KB
testcase_05 AC 18 ms
8,312 KB
testcase_06 AC 17 ms
7,992 KB
testcase_07 AC 17 ms
8,356 KB
testcase_08 AC 57 ms
13,808 KB
testcase_09 AC 264 ms
38,744 KB
testcase_10 AC 175 ms
27,820 KB
testcase_11 AC 70 ms
15,204 KB
testcase_12 AC 222 ms
33,372 KB
testcase_13 AC 17 ms
8,352 KB
testcase_14 AC 37 ms
10,704 KB
testcase_15 AC 18 ms
8,368 KB
testcase_16 AC 257 ms
38,376 KB
testcase_17 AC 20 ms
8,548 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def solve(n, a, b, x, y):
    ans = 0
    for i in range(n):
        ans += max(a[2 * i] + a[2 * i + 1] + x[i], a[2 * i] + b[2 * i + 1] + y[i], b[2 * i] + a[2 * i + 1] + y[i], b[2 * i] + b[2 * i + 1] + x[i])
    return ans

n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
x = list(map(int,input().split()))
y = list(map(int,input().split()))

print(solve(n, a, b, x, y))
0