結果

問題 No.406 鴨等間隔の法則
ユーザー mkanenobumkanenobu
提出日時 2018-03-20 20:06:37
言語 Nim
(2.0.2)
結果
RE  
実行時間 -
コード長 383 bytes
コンパイル時間 4,466 ms
コンパイル使用メモリ 68,656 KB
実行使用メモリ 14,156 KB
最終ジャッジ日時 2023-09-12 17:05:55
合計ジャッジ時間 6,199 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
6,472 KB
testcase_01 RE -
testcase_02 AC 2 ms
4,380 KB
testcase_03 RE -
testcase_04 AC 44 ms
10,840 KB
testcase_05 AC 16 ms
6,020 KB
testcase_06 AC 18 ms
6,236 KB
testcase_07 AC 17 ms
6,192 KB
testcase_08 AC 44 ms
10,936 KB
testcase_09 AC 49 ms
12,696 KB
testcase_10 AC 19 ms
6,524 KB
testcase_11 AC 38 ms
10,016 KB
testcase_12 AC 25 ms
8,268 KB
testcase_13 AC 22 ms
7,072 KB
testcase_14 RE -
testcase_15 RE -
testcase_16 AC 4 ms
4,380 KB
testcase_17 AC 3 ms
4,380 KB
testcase_18 AC 4 ms
4,380 KB
testcase_19 RE -
testcase_20 RE -
testcase_21 AC 7 ms
4,380 KB
testcase_22 RE -
testcase_23 AC 27 ms
8,508 KB
testcase_24 RE -
testcase_25 AC 54 ms
13,948 KB
testcase_26 RE -
testcase_27 RE -
testcase_28 AC 43 ms
13,952 KB
testcase_29 RE -
testcase_30 RE -
testcase_31 AC 46 ms
11,276 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sequtils, strutils, algorithm

var
    n = readLine(stdin).parseInt
    x = readLine(stdin).split.map(parseInt)

sort(x, cmp[int])

proc main():string =
    var m = x[1] - x[0]
    for i in 1..n:
        if x[i] - x[i - 1] == m:
            continue
        else:
            return "NO"
    if len(x) != len(deduplicate(x)):
        return "NO"
    return "YES"

echo main()
0