結果

問題 No.406 鴨等間隔の法則
ユーザー 👑 colognecologne
提出日時 2023-07-12 10:13:03
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 79 ms / 2,000 ms
コード長 296 bytes
コンパイル時間 182 ms
コンパイル使用メモリ 10,756 KB
実行使用メモリ 19,160 KB
最終ジャッジ日時 2023-10-12 00:22:42
合計ジャッジ時間 3,226 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
12,608 KB
testcase_01 AC 15 ms
7,916 KB
testcase_02 AC 15 ms
7,860 KB
testcase_03 AC 15 ms
7,924 KB
testcase_04 AC 64 ms
17,988 KB
testcase_05 AC 31 ms
11,488 KB
testcase_06 AC 32 ms
12,052 KB
testcase_07 AC 33 ms
12,016 KB
testcase_08 AC 60 ms
18,420 KB
testcase_09 AC 66 ms
18,964 KB
testcase_10 AC 34 ms
12,356 KB
testcase_11 AC 54 ms
16,624 KB
testcase_12 AC 40 ms
13,620 KB
testcase_13 AC 38 ms
13,060 KB
testcase_14 AC 68 ms
17,180 KB
testcase_15 AC 17 ms
8,748 KB
testcase_16 AC 18 ms
8,904 KB
testcase_17 AC 17 ms
8,496 KB
testcase_18 AC 17 ms
8,744 KB
testcase_19 AC 20 ms
9,132 KB
testcase_20 AC 22 ms
9,512 KB
testcase_21 AC 21 ms
9,380 KB
testcase_22 AC 28 ms
10,520 KB
testcase_23 AC 42 ms
13,740 KB
testcase_24 AC 59 ms
15,936 KB
testcase_25 AC 67 ms
18,952 KB
testcase_26 AC 76 ms
19,120 KB
testcase_27 AC 55 ms
19,160 KB
testcase_28 AC 46 ms
18,996 KB
testcase_29 AC 78 ms
19,024 KB
testcase_30 AC 79 ms
18,884 KB
testcase_31 AC 64 ms
18,620 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    N = int(input())
    A = sorted(map(int, input().split()))
    for i in range(N-1):
        if A[i] - A[i+1] != A[0] - A[1]:
            print('NO')
            return
    if A[0] == A[1]:
        print('NO')
    else:
        print('YES')


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