結果

問題 No.406 鴨等間隔の法則
ユーザー akichiakichi
提出日時 2017-08-27 16:39:15
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 131 ms / 2,000 ms
コード長 570 bytes
コンパイル時間 2,042 ms
コンパイル使用メモリ 104,248 KB
実行使用メモリ 31,164 KB
最終ジャッジ日時 2023-09-21 18:34:29
合計ジャッジ時間 6,722 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 93 ms
23,896 KB
testcase_01 AC 60 ms
21,604 KB
testcase_02 AC 61 ms
21,540 KB
testcase_03 AC 61 ms
21,752 KB
testcase_04 AC 125 ms
30,564 KB
testcase_05 AC 89 ms
23,544 KB
testcase_06 AC 90 ms
25,432 KB
testcase_07 AC 90 ms
23,600 KB
testcase_08 AC 124 ms
28,440 KB
testcase_09 AC 128 ms
26,804 KB
testcase_10 AC 93 ms
25,656 KB
testcase_11 AC 116 ms
27,900 KB
testcase_12 AC 98 ms
23,996 KB
testcase_13 AC 96 ms
24,416 KB
testcase_14 AC 119 ms
28,036 KB
testcase_15 AC 71 ms
21,996 KB
testcase_16 AC 72 ms
22,092 KB
testcase_17 AC 70 ms
23,908 KB
testcase_18 AC 73 ms
24,160 KB
testcase_19 AC 75 ms
24,236 KB
testcase_20 AC 76 ms
22,488 KB
testcase_21 AC 76 ms
22,668 KB
testcase_22 AC 81 ms
23,120 KB
testcase_23 AC 101 ms
28,652 KB
testcase_24 AC 114 ms
27,836 KB
testcase_25 AC 127 ms
30,924 KB
testcase_26 AC 129 ms
29,024 KB
testcase_27 AC 120 ms
31,164 KB
testcase_28 AC 125 ms
29,096 KB
testcase_29 AC 131 ms
30,972 KB
testcase_30 AC 129 ms
30,936 KB
testcase_31 AC 126 ms
28,828 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;
class Program {
    static void Main() {
        int n = int.Parse(Console.ReadLine());
        int[] x = Console.ReadLine().Split().Select(int.Parse).ToArray();
        Array.Sort(x);

        string ans = "YES";
        int k = x[1] - x[0];
        if (k == 0) {
            ans = "NO";
        } else {
            for (int i = 1; i < n - 1; i++) {
                if (x[i + 1] - x[i] != k) {
                    ans = "NO";
                    break;
                }
            }
        }
        Console.WriteLine(ans);
    }
}
0