結果

問題 No.406 鴨等間隔の法則
ユーザー kokoa1046kokoa1046
提出日時 2017-09-23 20:43:02
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 109 ms / 2,000 ms
コード長 434 bytes
コンパイル時間 84 ms
コンパイル使用メモリ 10,744 KB
実行使用メモリ 21,592 KB
最終ジャッジ日時 2023-09-21 18:34:54
合計ジャッジ時間 3,213 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 45 ms
14,948 KB
testcase_01 AC 15 ms
7,928 KB
testcase_02 AC 15 ms
7,812 KB
testcase_03 AC 14 ms
7,900 KB
testcase_04 AC 88 ms
21,004 KB
testcase_05 AC 41 ms
14,188 KB
testcase_06 AC 42 ms
14,572 KB
testcase_07 AC 46 ms
14,684 KB
testcase_08 AC 87 ms
21,592 KB
testcase_09 AC 93 ms
21,064 KB
testcase_10 AC 46 ms
14,880 KB
testcase_11 AC 75 ms
17,076 KB
testcase_12 AC 53 ms
14,944 KB
testcase_13 AC 51 ms
14,688 KB
testcase_14 AC 93 ms
20,212 KB
testcase_15 AC 17 ms
8,752 KB
testcase_16 AC 19 ms
9,508 KB
testcase_17 AC 17 ms
8,496 KB
testcase_18 AC 20 ms
9,524 KB
testcase_19 AC 22 ms
9,556 KB
testcase_20 AC 25 ms
9,944 KB
testcase_21 AC 23 ms
10,032 KB
testcase_22 AC 35 ms
13,044 KB
testcase_23 AC 57 ms
15,540 KB
testcase_24 AC 74 ms
16,476 KB
testcase_25 AC 96 ms
21,168 KB
testcase_26 AC 98 ms
21,176 KB
testcase_27 AC 47 ms
19,020 KB
testcase_28 AC 75 ms
21,100 KB
testcase_29 AC 109 ms
21,156 KB
testcase_30 AC 109 ms
21,092 KB
testcase_31 AC 95 ms
20,600 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding: utf-8
# Here your code !
input()
nums = list(map(int, input().split()))
nums_uniq = list(set(nums))
flag = False
nums.sort()
nums_uniq.sort()
if nums == nums_uniq:
    diff=abs(nums[0]-nums[1])
    curNum=nums[1]
    flag = True
    for i in nums:
        if abs(curNum-i)==diff:
            curNum = i
        else:
            flag=False
            break
if flag:
    print("YES")
else:
    print("NO")
    
        
    
0