結果

問題 No.406 鴨等間隔の法則
ユーザー mokraimokrai
提出日時 2017-10-15 00:21:23
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 435 bytes
コンパイル時間 136 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 24,580 KB
最終ジャッジ日時 2024-04-25 03:13:26
合計ジャッジ時間 3,298 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 54 ms
16,880 KB
testcase_01 AC 30 ms
10,752 KB
testcase_02 WA -
testcase_03 AC 30 ms
10,624 KB
testcase_04 AC 80 ms
22,660 KB
testcase_05 AC 47 ms
16,908 KB
testcase_06 AC 50 ms
16,016 KB
testcase_07 AC 48 ms
17,088 KB
testcase_08 AC 78 ms
22,556 KB
testcase_09 AC 82 ms
24,192 KB
testcase_10 AC 52 ms
17,000 KB
testcase_11 AC 67 ms
18,948 KB
testcase_12 AC 54 ms
17,604 KB
testcase_13 AC 53 ms
17,312 KB
testcase_14 AC 104 ms
22,764 KB
testcase_15 AC 34 ms
11,264 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 37 ms
12,160 KB
testcase_20 AC 39 ms
12,672 KB
testcase_21 WA -
testcase_22 AC 50 ms
15,508 KB
testcase_23 AC 56 ms
17,988 KB
testcase_24 AC 88 ms
18,608 KB
testcase_25 AC 83 ms
23,560 KB
testcase_26 AC 120 ms
24,456 KB
testcase_27 AC 71 ms
22,268 KB
testcase_28 AC 85 ms
23,504 KB
testcase_29 AC 120 ms
24,580 KB
testcase_30 AC 117 ms
24,328 KB
testcase_31 AC 82 ms
23,732 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    n = int(input())
    l = [int(i) for i in input().split()]
    if len(l) != len(list(set(l))):
        print("NO")
    else:
        sorted_list = sorted(l)
        diff = sorted_list[1] - sorted_list[0]
        for i in range(len(sorted_list) - 1):
            if diff != sorted_list[i+1] - sorted_list[i]:
                print("NO")
                break
        print("YES")

if __name__ == '__main__':
    main()
0