結果

問題 No.406 鴨等間隔の法則
ユーザー pirorirori_n712
提出日時 2018-06-21 01:51:28
言語 C#(csc)
(csc 3.9.0)
結果
RE  
実行時間 -
コード長 429 bytes
コンパイル時間 869 ms
コンパイル使用メモリ 106,240 KB
実行使用メモリ 29,824 KB
最終ジャッジ日時 2024-06-30 17:33:21
合計ジャッジ時間 4,299 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 RE * 2
other AC * 19 RE * 10
権限があれば一括ダウンロードができます
コンパイルメッセージ
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;

class No406{
    static void Main(){
        var n=Int32.Parse(Console.ReadLine());
        var k=Console.ReadLine().Split(' ').Select(j=>Int32.Parse(j)).OrderBy(l=>l).ToArray();
        var d=k[1]-k[0];
        var a="YES";
        for(int i=1;i<n;++i){
            if(k[i+1]-k[i]!=d){
                a="NO";
                break;
            }
        }
        Console.WriteLine(a);
    }
}
0