結果

問題 No.406 鴨等間隔の法則
ユーザー bluemeganebluemegane
提出日時 2018-09-17 20:11:26
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 124 ms / 2,000 ms
コード長 521 bytes
コンパイル時間 2,031 ms
コンパイル使用メモリ 100,712 KB
実行使用メモリ 30,216 KB
最終ジャッジ日時 2023-09-21 18:54:00
合計ジャッジ時間 6,498 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 86 ms
22,788 KB
testcase_01 AC 57 ms
22,788 KB
testcase_02 AC 56 ms
22,752 KB
testcase_03 AC 56 ms
20,764 KB
testcase_04 AC 116 ms
27,580 KB
testcase_05 AC 82 ms
20,608 KB
testcase_06 AC 83 ms
22,620 KB
testcase_07 AC 85 ms
20,628 KB
testcase_08 AC 114 ms
29,644 KB
testcase_09 AC 120 ms
30,044 KB
testcase_10 AC 87 ms
22,892 KB
testcase_11 AC 108 ms
29,052 KB
testcase_12 AC 92 ms
23,288 KB
testcase_13 AC 90 ms
23,652 KB
testcase_14 AC 111 ms
27,204 KB
testcase_15 AC 67 ms
23,204 KB
testcase_16 AC 68 ms
21,336 KB
testcase_17 AC 66 ms
21,088 KB
testcase_18 AC 67 ms
19,128 KB
testcase_19 AC 69 ms
23,396 KB
testcase_20 AC 70 ms
21,572 KB
testcase_21 AC 71 ms
21,748 KB
testcase_22 AC 76 ms
22,136 KB
testcase_23 AC 95 ms
25,696 KB
testcase_24 AC 106 ms
26,852 KB
testcase_25 AC 122 ms
28,044 KB
testcase_26 AC 122 ms
30,216 KB
testcase_27 AC 109 ms
30,144 KB
testcase_28 AC 115 ms
26,008 KB
testcase_29 AC 124 ms
28,116 KB
testcase_30 AC 122 ms
26,048 KB
testcase_31 AC 118 ms
30,048 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 Hello
{
    public static void Main()
    {
        var n = int.Parse(Console.ReadLine().Trim());
        string[] line = Console.ReadLine().Trim().Split(' ');
        var a = Array.ConvertAll(line, int.Parse);
        Array.Sort(a);
        var t = a[1] - a[0];
        if (t == 0) { Console.WriteLine("NO"); goto end; }
        for (int i = 1; i < n-1; i++)
            if (a[i + 1] - a[i] != t) { Console.WriteLine("NO"); goto end; }
        Console.WriteLine("YES");
        end:;
    }
}
0