結果

問題 No.406 鴨等間隔の法則
ユーザー otsunekootsuneko
提出日時 2021-05-07 15:25:01
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 102 ms / 2,000 ms
コード長 281 bytes
コンパイル時間 426 ms
コンパイル使用メモリ 87,288 KB
実行使用メモリ 92,648 KB
最終ジャッジ日時 2023-10-13 06:36:47
合計ジャッジ時間 5,585 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
81,084 KB
testcase_01 AC 63 ms
71,372 KB
testcase_02 AC 62 ms
71,480 KB
testcase_03 AC 61 ms
71,108 KB
testcase_04 AC 95 ms
90,048 KB
testcase_05 AC 74 ms
79,600 KB
testcase_06 AC 75 ms
79,612 KB
testcase_07 AC 76 ms
80,284 KB
testcase_08 AC 96 ms
89,668 KB
testcase_09 AC 100 ms
91,620 KB
testcase_10 AC 78 ms
81,136 KB
testcase_11 AC 90 ms
88,000 KB
testcase_12 AC 79 ms
82,244 KB
testcase_13 AC 79 ms
82,212 KB
testcase_14 AC 93 ms
90,336 KB
testcase_15 AC 64 ms
75,668 KB
testcase_16 AC 68 ms
75,740 KB
testcase_17 AC 68 ms
75,920 KB
testcase_18 AC 64 ms
75,784 KB
testcase_19 AC 68 ms
76,444 KB
testcase_20 AC 69 ms
76,420 KB
testcase_21 AC 66 ms
75,796 KB
testcase_22 AC 73 ms
77,924 KB
testcase_23 AC 81 ms
83,244 KB
testcase_24 AC 93 ms
88,388 KB
testcase_25 AC 99 ms
91,920 KB
testcase_26 AC 98 ms
92,356 KB
testcase_27 AC 86 ms
91,240 KB
testcase_28 AC 85 ms
92,220 KB
testcase_29 AC 102 ms
92,460 KB
testcase_30 AC 101 ms
92,648 KB
testcase_31 AC 98 ms
91,592 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
x = sorted(list(map(int,input().split())))

diff = -1
for i in range(len(x)-1):
    if diff == -1:
        diff = x[i+1]-x[i]
    else:
        if diff != x[i+1]-x[i] or x[i+1]-x[i] == 0:
            print("NO")
            break
else:
    print("YES")
0