結果

問題 No.185 和風
ユーザー mencottonmencotton
提出日時 2017-12-26 21:36:51
言語 C#(csc)
(csc 3.9.0)
結果
RE  
実行時間 -
コード長 674 bytes
コンパイル時間 1,386 ms
コンパイル使用メモリ 105,216 KB
実行使用メモリ 19,328 KB
最終ジャッジ日時 2024-05-10 03:35:21
合計ジャッジ時間 1,629 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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;
using System.Text;
using System.Threading.Tasks;

namespace template
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int[] a = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int ret = a[1] - a[0]; bool flag = true;
            for (int i = 0; i < n; i++)
            {
                int[] x = Console.ReadLine().Split().Select(int.Parse).ToArray();
                if (x[1] - x[0] != ret) flag = false;
            }
            Console.WriteLine(flag && ret > 0 ? ret : -1);
        }
    }
}
0