結果
| 問題 | 
                            No.178 美しいWhitespace (1)
                             | 
                    
| コンテスト | |
| ユーザー | 
                             しらゆき
                         | 
                    
| 提出日時 | 2015-11-19 15:38:56 | 
| 言語 | C#(csc)  (csc 3.9.0)  | 
                    
| 結果 | 
                             
                                RE
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 595 bytes | 
| コンパイル時間 | 974 ms | 
| コンパイル使用メモリ | 109,832 KB | 
| 実行使用メモリ | 26,856 KB | 
| 最終ジャッジ日時 | 2024-09-13 17:01:48 | 
| 合計ジャッジ時間 | 2,291 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 4 | 
| other | AC * 6 WA * 1 RE * 14 | 
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
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;
            }
        }
        long ans = (c.Max() * n - c.Sum()) / 2;
        Console.WriteLine(ans);
    }
}
            
            
            
        
            
しらゆき