結果

問題 No.406 鴨等間隔の法則
ユーザー phsplsphspls
提出日時 2020-03-28 13:24:20
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 143 ms / 2,000 ms
コード長 488 bytes
コンパイル時間 3,607 ms
コンパイル使用メモリ 103,224 KB
実行使用メモリ 31,160 KB
最終ジャッジ日時 2023-09-21 19:30:16
合計ジャッジ時間 8,646 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 102 ms
24,412 KB
testcase_01 AC 67 ms
21,612 KB
testcase_02 AC 67 ms
25,684 KB
testcase_03 AC 68 ms
21,592 KB
testcase_04 AC 137 ms
31,020 KB
testcase_05 AC 98 ms
26,000 KB
testcase_06 AC 100 ms
24,020 KB
testcase_07 AC 101 ms
24,112 KB
testcase_08 AC 138 ms
31,160 KB
testcase_09 AC 141 ms
27,360 KB
testcase_10 AC 103 ms
24,316 KB
testcase_11 AC 125 ms
28,312 KB
testcase_12 AC 109 ms
26,540 KB
testcase_13 AC 107 ms
24,868 KB
testcase_14 AC 132 ms
30,296 KB
testcase_15 AC 78 ms
22,140 KB
testcase_16 AC 82 ms
22,500 KB
testcase_17 AC 80 ms
22,172 KB
testcase_18 AC 80 ms
22,588 KB
testcase_19 AC 79 ms
22,344 KB
testcase_20 AC 81 ms
22,500 KB
testcase_21 AC 83 ms
22,868 KB
testcase_22 AC 88 ms
23,100 KB
testcase_23 AC 111 ms
26,852 KB
testcase_24 AC 121 ms
27,788 KB
testcase_25 AC 143 ms
29,392 KB
testcase_26 AC 140 ms
31,124 KB
testcase_27 AC 128 ms
29,112 KB
testcase_28 AC 137 ms
29,400 KB
testcase_29 AC 139 ms
29,172 KB
testcase_30 AC 139 ms
31,056 KB
testcase_31 AC 138 ms
29,188 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;

public class P0406 {
    public static void Main() {
        var n = int.Parse(Console.ReadLine().Trim());
        var x = Console.ReadLine().Trim().Split(' ').Select(int.Parse).ToList();
        x.Sort();
        var result = x.SkipLast(1).Zip(x.Skip(1), (i, j) => j - i).Distinct().ToList();
        if(result.Count() == 1 && result[0] > 0) {
            Console.WriteLine("YES");
        } else {
            Console.WriteLine("NO");
        }
    }
}
0