結果

問題 No.406 鴨等間隔の法則
ユーザー No-RaNo-Ra
提出日時 2017-08-05 21:10:03
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 439 bytes
コンパイル時間 100 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 21,668 KB
最終ジャッジ日時 2024-04-25 01:13:18
合計ジャッジ時間 4,002 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 28 ms
10,752 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 124 ms
19,524 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 37 ms
11,648 KB
testcase_20 AC 40 ms
12,032 KB
testcase_21 WA -
testcase_22 AC 52 ms
13,220 KB
testcase_23 WA -
testcase_24 AC 104 ms
18,576 KB
testcase_25 WA -
testcase_26 AC 136 ms
21,668 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 139 ms
21,536 KB
testcase_30 AC 139 ms
21,632 KB
testcase_31 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
xlist = input().split()
xlist = [int(i) for i in xlist]
xlist.sort()

distlist = [0 for i in range(N)]

for i in range(0, N-1):
    distlist[i] = xlist[i+1] - xlist[i]
temp = distlist[0]

flag = 1
for i in range(0, N-1):
    if distlist[i] == 0:
        flag = 0
    elif distlist[i] == temp:
        pass
    else:
        flag = 0

if flag == 1:
    print("YES")
elif flag == 0:
    print("No")
else:
    print("ERROR")
0