結果

問題 No.185 和風
ユーザー abL8ZLsTbFabL8ZLsTbF
提出日時 2016-03-20 21:43:17
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 28 ms / 1,000 ms
コード長 751 bytes
コンパイル時間 1,696 ms
コンパイル使用メモリ 108,364 KB
実行使用メモリ 24,208 KB
最終ジャッジ日時 2024-04-08 21:08:21
合計ジャッジ時間 1,842 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
24,208 KB
testcase_01 AC 28 ms
24,208 KB
testcase_02 AC 27 ms
24,208 KB
testcase_03 AC 27 ms
24,208 KB
testcase_04 AC 26 ms
24,208 KB
testcase_05 AC 28 ms
24,208 KB
testcase_06 AC 28 ms
24,208 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;

public class Program {
    public static void Main() {
        int n = int.Parse(Console.ReadLine());
        int[] input = Array.ConvertAll(Console.ReadLine().Split(), delegate(string value) {
            return int.Parse(value);
        });
        int result = input[1]-input[0];
        if (result <= 0) {
            Console.WriteLine(-1);
            return;
        }
        for (int i = 1; i < n; i++) {
            input = Array.ConvertAll(Console.ReadLine().Split(), delegate(string value) {
                return int.Parse(value);
            });
            if (result != input[1]-input[0]) {
                Console.WriteLine(-1);
                return;
            }
        }
        Console.WriteLine(result);
    }
}
0