結果
| 問題 | 
                            No.185 和風
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2020-06-18 15:59:02 | 
| 言語 | C#(csc)  (csc 3.9.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 549 bytes | 
| コンパイル時間 | 1,986 ms | 
| コンパイル使用メモリ | 114,472 KB | 
| 実行使用メモリ | 27,176 KB | 
| 最終ジャッジ日時 | 2024-07-03 12:50:24 | 
| 合計ジャッジ時間 | 2,734 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge5 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 6 WA * 1 | 
コンパイルメッセージ
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;
namespace _0185
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = int.Parse(Console.ReadLine());
            var d = new int[n];
            for(var i = 0; i < n; i++){
                var _ = Console.ReadLine().Split();
                var x = int.Parse(_[0]);
                var y = int.Parse(_[1]);
                d[i] = y - x;
            }
            var f = d.First();
            Console.WriteLine(d.All(x => x == f) && f >= 0 ? f : -1);
        }
    }
}