結果

問題 No.178 美しいWhitespace (1)
ユーザー しらゆきしらゆき
提出日時 2015-11-19 15:31:34
言語 C#(csc)
(csc 3.9.0)
結果
RE  
実行時間 -
コード長 594 bytes
コンパイル時間 2,022 ms
コンパイル使用メモリ 103,896 KB
実行使用メモリ 23,608 KB
最終ジャッジ日時 2023-10-11 18:04:33
合計ジャッジ時間 4,874 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 58 ms
21,432 KB
testcase_01 AC 58 ms
21,412 KB
testcase_02 AC 58 ms
21,404 KB
testcase_03 AC 58 ms
21,500 KB
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 AC 58 ms
21,364 KB
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 AC 60 ms
21,460 KB
testcase_12 AC 59 ms
21,548 KB
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 AC 60 ms
23,404 KB
testcase_19 RE -
testcase_20 AC 60 ms
21,568 KB
testcase_21 RE -
testcase_22 WA -
testcase_23 RE -
testcase_24 AC 59 ms
21,612 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.Linq;

class Program
{
    static void Main()
    {
        int n = int.Parse(Console.ReadLine());
        int[] c = new int[n];
        for (int i = 0; i < n; i++)
        {
            string[] s = Console.ReadLine().Split();
            c[i] = int.Parse(s[0]) + int.Parse(s[1]) * 4;
        }

        for(int i=0;i< n; i++)
        {
            if ((c[i] - c[0]) % 2 != 0)
            {
                Console.WriteLine(-1);
                return;
            }
        }

        int ans = (c.Max() * n - c.Sum()) / 2;

        Console.WriteLine(ans);
    }
}
0