結果

問題 No.185 和風
ユーザー curryudon08curryudon08
提出日時 2020-06-18 16:00:02
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 62 ms / 1,000 ms
コード長 548 bytes
コンパイル時間 2,277 ms
コンパイル使用メモリ 101,916 KB
実行使用メモリ 23,488 KB
最終ジャッジ日時 2023-09-16 12:08:14
合計ジャッジ時間 3,327 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 60 ms
19,460 KB
testcase_01 AC 61 ms
21,408 KB
testcase_02 AC 62 ms
23,488 KB
testcase_03 AC 61 ms
21,380 KB
testcase_04 AC 62 ms
21,428 KB
testcase_05 AC 60 ms
21,320 KB
testcase_06 AC 61 ms
19,340 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;

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);
        }
    }
}
0