結果

問題 No.406 鴨等間隔の法則
ユーザー noriocnorioc
提出日時 2016-10-08 04:32:11
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 81 ms / 2,000 ms
コード長 347 bytes
コンパイル時間 596 ms
コンパイル使用メモリ 10,532 KB
実行使用メモリ 19,176 KB
最終ジャッジ日時 2023-09-21 18:15:05
合計ジャッジ時間 3,172 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
13,644 KB
testcase_01 AC 15 ms
7,872 KB
testcase_02 AC 15 ms
7,824 KB
testcase_03 AC 16 ms
7,840 KB
testcase_04 AC 74 ms
18,060 KB
testcase_05 AC 37 ms
13,332 KB
testcase_06 AC 38 ms
13,500 KB
testcase_07 AC 38 ms
13,644 KB
testcase_08 AC 74 ms
18,340 KB
testcase_09 AC 78 ms
18,856 KB
testcase_10 AC 40 ms
13,736 KB
testcase_11 AC 64 ms
16,848 KB
testcase_12 AC 46 ms
14,024 KB
testcase_13 AC 45 ms
13,840 KB
testcase_14 AC 68 ms
17,028 KB
testcase_15 AC 18 ms
8,952 KB
testcase_16 AC 20 ms
9,516 KB
testcase_17 AC 18 ms
8,664 KB
testcase_18 AC 20 ms
9,676 KB
testcase_19 AC 20 ms
9,112 KB
testcase_20 AC 22 ms
9,648 KB
testcase_21 AC 24 ms
10,584 KB
testcase_22 AC 29 ms
10,988 KB
testcase_23 AC 49 ms
14,528 KB
testcase_24 AC 57 ms
16,156 KB
testcase_25 AC 80 ms
18,868 KB
testcase_26 AC 74 ms
18,988 KB
testcase_27 AC 53 ms
19,176 KB
testcase_28 AC 56 ms
18,960 KB
testcase_29 AC 78 ms
19,164 KB
testcase_30 AC 81 ms
18,836 KB
testcase_31 AC 77 ms
18,488 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def readint():
    return int(input())

def readints():
    return list(map(int, input().split()))

def calc(xs):
    ys = sorted(xs)
    s = set([a - b for a, b in zip(ys, ys[1:])])
    return len(s) == 1 and 0 not in s

def main():
    readint()
    xs = readints()
    print("YES" if calc(xs) else "NO")

if __name__ == "__main__":
    main()
0