結果

問題 No.406 鴨等間隔の法則
ユーザー piconic_Xpiconic_X
提出日時 2016-08-23 17:32:17
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 327 bytes
コンパイル時間 85 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 21,736 KB
最終ジャッジ日時 2024-04-24 20:31:39
合計ジャッジ時間 2,749 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 46 ms
15,408 KB
testcase_01 AC 26 ms
10,880 KB
testcase_02 AC 25 ms
10,880 KB
testcase_03 AC 25 ms
10,624 KB
testcase_04 AC 73 ms
20,440 KB
testcase_05 AC 43 ms
14,460 KB
testcase_06 AC 43 ms
14,592 KB
testcase_07 AC 46 ms
14,616 KB
testcase_08 AC 71 ms
20,996 KB
testcase_09 AC 77 ms
21,416 KB
testcase_10 AC 47 ms
15,392 KB
testcase_11 AC 65 ms
19,068 KB
testcase_12 AC 50 ms
15,988 KB
testcase_13 AC 48 ms
15,740 KB
testcase_14 WA -
testcase_15 AC 27 ms
11,392 KB
testcase_16 AC 27 ms
11,520 KB
testcase_17 AC 26 ms
11,136 KB
testcase_18 AC 28 ms
11,648 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 32 ms
12,160 KB
testcase_22 WA -
testcase_23 AC 52 ms
16,512 KB
testcase_24 WA -
testcase_25 AC 80 ms
21,480 KB
testcase_26 WA -
testcase_27 AC 59 ms
21,732 KB
testcase_28 AC 56 ms
21,460 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 74 ms
20,908 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
xs = sorted(list(map(int, input().split())))
nw = xs[1]
itv = nw - xs[0]
if itv == 0:
    print('NO')
else:
    for i in range(1, N-1):
        nxt = xs[i+1]
        if nxt - nw == itv:
            continue
        else:
            print('NO')
            break
        nw = nxt
    else:
        print('YES')
0