結果

問題 No.406 鴨等間隔の法則
ユーザー kmtrc130kmtrc130
提出日時 2017-06-02 09:28:33
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 123 ms / 2,000 ms
コード長 606 bytes
コンパイル時間 3,729 ms
コンパイル使用メモリ 106,788 KB
実行使用メモリ 31,040 KB
最終ジャッジ日時 2023-09-21 18:29:04
合計ジャッジ時間 7,536 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 87 ms
23,648 KB
testcase_01 AC 58 ms
21,560 KB
testcase_02 AC 58 ms
23,516 KB
testcase_03 AC 59 ms
21,500 KB
testcase_04 AC 116 ms
28,624 KB
testcase_05 AC 84 ms
23,432 KB
testcase_06 AC 85 ms
23,400 KB
testcase_07 AC 86 ms
23,448 KB
testcase_08 AC 116 ms
28,528 KB
testcase_09 AC 122 ms
30,888 KB
testcase_10 AC 87 ms
21,532 KB
testcase_11 AC 110 ms
27,836 KB
testcase_12 AC 94 ms
24,052 KB
testcase_13 AC 92 ms
24,416 KB
testcase_14 AC 113 ms
30,200 KB
testcase_15 AC 70 ms
22,092 KB
testcase_16 AC 71 ms
22,020 KB
testcase_17 AC 68 ms
23,880 KB
testcase_18 AC 69 ms
22,212 KB
testcase_19 AC 71 ms
22,316 KB
testcase_20 AC 73 ms
24,364 KB
testcase_21 AC 73 ms
22,512 KB
testcase_22 AC 79 ms
21,192 KB
testcase_23 AC 96 ms
26,460 KB
testcase_24 AC 107 ms
27,640 KB
testcase_25 AC 123 ms
28,876 KB
testcase_26 AC 123 ms
29,048 KB
testcase_27 AC 111 ms
30,976 KB
testcase_28 AC 117 ms
31,040 KB
testcase_29 AC 122 ms
28,940 KB
testcase_30 AC 121 ms
29,132 KB
testcase_31 AC 120 ms
28,808 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.Collections.Generic;
using System.Linq;

class Program
{
    static void Main(string[] args)
    {
        int N = int.Parse(Console.ReadLine());
        int[] X = Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToArray();
        Array.Sort(X);

        bool isOK = true;

        int diff = X[0] - X[1];
        for (int i = 0; i < X.Length - 1; i++)
        {
            if (X[i] == X[i + 1] || X[i] - X[i + 1] != diff)
            {
                isOK = false;
                break;
            }
        }
        Console.WriteLine(isOK ? "YES" : "NO");
    }
}
0