結果

問題 No.178 美しいWhitespace (1)
ユーザー yurarayurara
提出日時 2019-04-14 12:16:15
言語 C#(csc)
(csc 3.9.0)
結果
RE  
実行時間 -
コード長 600 bytes
コンパイル時間 1,845 ms
コンパイル使用メモリ 110,676 KB
実行使用メモリ 25,444 KB
最終ジャッジ日時 2023-10-18 22:04:59
合計ジャッジ時間 4,026 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
25,440 KB
testcase_01 AC 31 ms
25,440 KB
testcase_02 AC 30 ms
25,424 KB
testcase_03 AC 31 ms
25,440 KB
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 AC 33 ms
25,432 KB
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 AC 33 ms
25,432 KB
testcase_12 AC 32 ms
25,432 KB
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 AC 32 ms
25,432 KB
testcase_19 RE -
testcase_20 AC 32 ms
25,432 KB
testcase_21 RE -
testcase_22 RE -
testcase_23 AC 53 ms
25,444 KB
testcase_24 AC 42 ms
25,432 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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;

public class Program
{
    public static void Main()
    {
        var count = int.Parse(Console.ReadLine());

        var inputs = new List<int>();
        for (var i = 0; i < count; i++){
            var l = Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToList();
            inputs.Add(l[0] + l[1] * 4);
        }

        if (inputs.All(x => x % 2 == inputs.Max() % 2))
            Console.Write("{0}", inputs.Sum(x => inputs.Max() - x) / 2);
        else
            Console.Write("{0}", -1);

        return;
    }
}
0