結果

問題 No.406 鴨等間隔の法則
ユーザー mencottonmencotton
提出日時 2017-12-27 17:21:38
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 127 ms / 2,000 ms
コード長 546 bytes
コンパイル時間 2,554 ms
コンパイル使用メモリ 102,572 KB
実行使用メモリ 31,072 KB
最終ジャッジ日時 2023-09-21 18:42:28
合計ジャッジ時間 6,864 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 91 ms
23,720 KB
testcase_01 AC 59 ms
23,680 KB
testcase_02 AC 59 ms
21,724 KB
testcase_03 AC 59 ms
23,760 KB
testcase_04 AC 121 ms
28,564 KB
testcase_05 AC 87 ms
23,556 KB
testcase_06 AC 87 ms
23,596 KB
testcase_07 AC 88 ms
23,584 KB
testcase_08 AC 120 ms
28,512 KB
testcase_09 AC 127 ms
28,896 KB
testcase_10 AC 91 ms
25,708 KB
testcase_11 AC 115 ms
27,896 KB
testcase_12 AC 97 ms
24,180 KB
testcase_13 AC 95 ms
24,484 KB
testcase_14 AC 117 ms
30,224 KB
testcase_15 AC 69 ms
22,136 KB
testcase_16 AC 70 ms
24,104 KB
testcase_17 AC 67 ms
20,016 KB
testcase_18 AC 70 ms
22,344 KB
testcase_19 AC 71 ms
24,328 KB
testcase_20 AC 74 ms
22,456 KB
testcase_21 AC 74 ms
22,396 KB
testcase_22 AC 80 ms
23,040 KB
testcase_23 AC 99 ms
26,552 KB
testcase_24 AC 111 ms
27,892 KB
testcase_25 AC 127 ms
29,012 KB
testcase_26 AC 127 ms
29,108 KB
testcase_27 AC 116 ms
29,056 KB
testcase_28 AC 126 ms
31,072 KB
testcase_29 AC 125 ms
29,052 KB
testcase_30 AC 124 ms
28,912 KB
testcase_31 AC 123 ms
28,868 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;

namespace Test
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int[] x = Console.ReadLine().Split().Select(int.Parse).ToArray(); Array.Sort(x);
            int a = x[1] - x[0]; bool ret = a != 0;
            for (int i = 1; i < n; i++)
            {
                if (x[i] - x[i - 1] != a) ret = false;
            }
            Console.WriteLine(ret ? "YES" : "NO");
        }
    }
}
0