結果

問題 No.2196 Pair Bonus
ユーザー 👑 kakel-sankakel-san
提出日時 2023-09-02 22:58:05
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 335 ms / 2,000 ms
コード長 885 bytes
コンパイル時間 1,605 ms
コンパイル使用メモリ 69,664 KB
実行使用メモリ 62,504 KB
最終ジャッジ日時 2023-09-02 22:58:12
合計ジャッジ時間 6,848 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 57 ms
21,724 KB
testcase_01 AC 60 ms
21,816 KB
testcase_02 AC 59 ms
23,916 KB
testcase_03 AC 335 ms
62,504 KB
testcase_04 AC 315 ms
58,468 KB
testcase_05 AC 67 ms
22,176 KB
testcase_06 AC 64 ms
21,916 KB
testcase_07 AC 66 ms
23,984 KB
testcase_08 AC 103 ms
31,212 KB
testcase_09 AC 299 ms
60,376 KB
testcase_10 AC 228 ms
50,748 KB
testcase_11 AC 117 ms
39,440 KB
testcase_12 AC 262 ms
60,424 KB
testcase_13 AC 68 ms
22,088 KB
testcase_14 AC 84 ms
26,540 KB
testcase_15 AC 66 ms
22,280 KB
testcase_16 AC 304 ms
62,460 KB
testcase_17 AC 70 ms
24,500 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

using System;
using static System.Console;
using System.Linq;
using System.Collections.Generic;
class Program
{
    static int NN => int.Parse(ReadLine());
    static long[] NList => ReadLine().Split().Select(long.Parse).ToArray();
    public static void Main()
    {
        Solve();
    }
    static void Solve()
    {
        var n = NN;
        var a = NList;
        var b = NList;
        var x = NList;
        var y = NList;
        var ans = 0L;
        for (var i = 0; i < n; ++i)
        {
            var sub = 0L;
            sub = Math.Max(sub, a[i * 2] + a[i * 2 + 1] + x[i]);
            sub = Math.Max(sub, a[i * 2] + b[i * 2 + 1] + y[i]);
            sub = Math.Max(sub, b[i * 2] + a[i * 2 + 1] + y[i]);
            sub = Math.Max(sub, b[i * 2] + b[i * 2 + 1] + x[i]);
            ans += sub;
        }
        WriteLine(ans);
    }
}
0