結果

問題 No.545 ママの大事な二人の子供
ユーザー NoNo
提出日時 2018-01-27 22:36:52
言語 C#(csc)
(csc 3.9.0)
結果
MLE  
実行時間 -
コード長 852 bytes
コンパイル時間 3,524 ms
コンパイル使用メモリ 106,392 KB
実行使用メモリ 822,312 KB
最終ジャッジ日時 2023-08-28 10:04:41
合計ジャッジ時間 10,606 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 64 ms
21,872 KB
testcase_01 AC 64 ms
21,764 KB
testcase_02 AC 63 ms
21,708 KB
testcase_03 AC 63 ms
21,760 KB
testcase_04 AC 64 ms
21,752 KB
testcase_05 AC 64 ms
23,604 KB
testcase_06 AC 63 ms
21,772 KB
testcase_07 AC 64 ms
23,668 KB
testcase_08 AC 62 ms
19,712 KB
testcase_09 AC 63 ms
21,756 KB
testcase_10 AC 64 ms
23,760 KB
testcase_11 AC 64 ms
23,788 KB
testcase_12 AC 64 ms
21,752 KB
testcase_13 AC 66 ms
21,768 KB
testcase_14 AC 67 ms
24,348 KB
testcase_15 AC 63 ms
19,808 KB
testcase_16 AC 78 ms
29,484 KB
testcase_17 AC 133 ms
47,284 KB
testcase_18 AC 1,435 ms
340,472 KB
testcase_19 MLE -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Collections.Generic;
using System.Linq;

namespace y
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = int.Parse(Console.ReadLine());
            var li1 = new List<int[]>();
            li1.Add(new int[] { 0, 0 });

            for (int i = 0; i < n; i++)
            {
                var li2 = new List<int[]>();
                var num = Console.ReadLine().Split().Select(x => int.Parse(x)).ToArray();
                foreach (var item in li1)
                {
                    li2.Add(new int[] { item[0] + num[0], item[1] });
                    li2.Add(new int[] { item[0], item[1] + num[1] });
                }
                li1 = li2;
            }

            var ans = li1.Min(x => Math.Abs( x[0] - x[1]));
            Console.WriteLine(ans);
        }
    }
}
0