結果

問題 No.406 鴨等間隔の法則
ユーザー bluemeganebluemegane
提出日時 2018-09-17 20:09:14
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 138 ms / 2,000 ms
コード長 642 bytes
コンパイル時間 2,043 ms
コンパイル使用メモリ 102,668 KB
実行使用メモリ 34,792 KB
最終ジャッジ日時 2023-09-21 18:53:49
合計ジャッジ時間 6,426 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 83 ms
25,680 KB
testcase_01 AC 60 ms
21,628 KB
testcase_02 AC 59 ms
19,584 KB
testcase_03 AC 59 ms
21,632 KB
testcase_04 AC 105 ms
34,204 KB
testcase_05 AC 82 ms
27,316 KB
testcase_06 AC 83 ms
27,436 KB
testcase_07 AC 81 ms
25,392 KB
testcase_08 AC 105 ms
30,348 KB
testcase_09 AC 108 ms
32,788 KB
testcase_10 AC 84 ms
23,904 KB
testcase_11 AC 99 ms
31,388 KB
testcase_12 AC 87 ms
26,068 KB
testcase_13 AC 85 ms
26,048 KB
testcase_14 AC 125 ms
31,788 KB
testcase_15 AC 68 ms
23,956 KB
testcase_16 AC 72 ms
22,324 KB
testcase_17 AC 72 ms
21,928 KB
testcase_18 AC 73 ms
22,592 KB
testcase_19 AC 74 ms
22,820 KB
testcase_20 AC 76 ms
22,784 KB
testcase_21 AC 76 ms
22,628 KB
testcase_22 AC 83 ms
25,616 KB
testcase_23 AC 90 ms
30,392 KB
testcase_24 AC 117 ms
31,120 KB
testcase_25 AC 108 ms
32,896 KB
testcase_26 AC 136 ms
32,736 KB
testcase_27 AC 100 ms
28,940 KB
testcase_28 AC 107 ms
34,792 KB
testcase_29 AC 135 ms
32,844 KB
testcase_30 AC 138 ms
34,704 KB
testcase_31 AC 107 ms
32,572 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System.Collections.Generic;
using System.Linq;
using System;

public class Hello
{
    public static void Main()
    {
        var n = int.Parse(Console.ReadLine().Trim());
        string[] line = Console.ReadLine().Trim().Split(' ');
        var a = new List<int>(n);
        for (int i = 0; i < n; i++) a.Add(int.Parse(line[i]));
        if (a.Count() != a.Distinct().Count()) { Console.WriteLine("NO"); goto end; }
        a.Sort();
        var t = a[1] - a[0];
        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