結果

問題 No.406 鴨等間隔の法則
ユーザー koba-e964koba-e964
提出日時 2016-08-05 22:28:50
言語 Ruby
(3.3.0)
結果
AC  
実行時間 146 ms / 2,000 ms
コード長 125 bytes
コンパイル時間 76 ms
コンパイル使用メモリ 11,300 KB
実行使用メモリ 23,572 KB
最終ジャッジ日時 2023-09-21 17:41:22
合計ジャッジ時間 4,883 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 99 ms
18,120 KB
testcase_01 AC 77 ms
15,220 KB
testcase_02 AC 75 ms
15,236 KB
testcase_03 AC 76 ms
15,160 KB
testcase_04 AC 125 ms
22,688 KB
testcase_05 AC 94 ms
17,624 KB
testcase_06 AC 95 ms
17,944 KB
testcase_07 AC 96 ms
17,900 KB
testcase_08 AC 122 ms
22,384 KB
testcase_09 AC 135 ms
23,572 KB
testcase_10 AC 98 ms
18,324 KB
testcase_11 AC 116 ms
21,468 KB
testcase_12 AC 104 ms
19,160 KB
testcase_13 AC 101 ms
19,032 KB
testcase_14 AC 127 ms
21,764 KB
testcase_15 AC 80 ms
15,396 KB
testcase_16 AC 79 ms
15,344 KB
testcase_17 AC 77 ms
15,392 KB
testcase_18 AC 78 ms
15,516 KB
testcase_19 AC 80 ms
15,452 KB
testcase_20 AC 82 ms
15,924 KB
testcase_21 AC 81 ms
15,788 KB
testcase_22 AC 87 ms
16,940 KB
testcase_23 AC 105 ms
19,588 KB
testcase_24 AC 121 ms
21,040 KB
testcase_25 AC 134 ms
23,384 KB
testcase_26 AC 146 ms
23,392 KB
testcase_27 AC 134 ms
23,368 KB
testcase_28 AC 124 ms
23,444 KB
testcase_29 AC 145 ms
23,508 KB
testcase_30 AC 143 ms
23,104 KB
testcase_31 AC 132 ms
22,868 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n=gets.to_i;c=gets.split.map(&:to_i).sort;d=c[1]-c[0]
puts(if(0..n-2).find{|v|c[v+1]-c[v]!=d}||d==0 then "NO" else "YES" end)
0