結果

問題 No.406 鴨等間隔の法則
ユーザー TatsunoTatsuno
提出日時 2016-08-05 22:28:44
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 92 ms / 2,000 ms
コード長 198 bytes
コンパイル時間 141 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 21,728 KB
最終ジャッジ日時 2024-07-07 11:17:54
合計ジャッジ時間 2,760 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 45 ms
15,276 KB
testcase_01 AC 25 ms
10,496 KB
testcase_02 AC 23 ms
10,496 KB
testcase_03 AC 23 ms
10,496 KB
testcase_04 AC 68 ms
20,436 KB
testcase_05 AC 39 ms
14,200 KB
testcase_06 AC 41 ms
14,208 KB
testcase_07 AC 41 ms
14,512 KB
testcase_08 AC 69 ms
21,012 KB
testcase_09 AC 73 ms
21,276 KB
testcase_10 AC 44 ms
14,920 KB
testcase_11 AC 61 ms
18,940 KB
testcase_12 AC 49 ms
15,988 KB
testcase_13 AC 47 ms
15,484 KB
testcase_14 AC 83 ms
19,488 KB
testcase_15 AC 27 ms
11,264 KB
testcase_16 AC 27 ms
11,392 KB
testcase_17 AC 26 ms
10,880 KB
testcase_18 AC 26 ms
11,392 KB
testcase_19 AC 29 ms
11,520 KB
testcase_20 AC 31 ms
11,904 KB
testcase_21 AC 28 ms
12,032 KB
testcase_22 AC 38 ms
13,056 KB
testcase_23 AC 49 ms
16,376 KB
testcase_24 AC 74 ms
18,552 KB
testcase_25 AC 73 ms
21,348 KB
testcase_26 AC 90 ms
21,728 KB
testcase_27 AC 70 ms
21,600 KB
testcase_28 AC 53 ms
21,352 KB
testcase_29 AC 92 ms
21,600 KB
testcase_30 AC 90 ms
21,476 KB
testcase_31 AC 71 ms
20,768 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
x=list(sorted(map(int,input().split())))
d=x[1] - x[0]
ok = True
for i in range(n-1):
    if x[i+1] - x[i] != d:
        ok = False
        break
print("YES" if ok and d>0 else "NO")
0