結果

問題 No.406 鴨等間隔の法則
ユーザー 👑 horiesinitihoriesiniti
提出日時 2017-06-24 14:10:09
言語 Ruby
(3.3.0)
結果
AC  
実行時間 151 ms / 2,000 ms
コード長 179 bytes
コンパイル時間 34 ms
コンパイル使用メモリ 11,388 KB
実行使用メモリ 23,628 KB
最終ジャッジ日時 2023-09-21 18:31:42
合計ジャッジ時間 5,025 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 110 ms
18,244 KB
testcase_01 AC 76 ms
15,036 KB
testcase_02 AC 75 ms
15,116 KB
testcase_03 AC 74 ms
15,276 KB
testcase_04 AC 139 ms
22,556 KB
testcase_05 AC 100 ms
17,668 KB
testcase_06 AC 102 ms
18,040 KB
testcase_07 AC 102 ms
18,004 KB
testcase_08 AC 135 ms
22,400 KB
testcase_09 AC 148 ms
23,412 KB
testcase_10 AC 103 ms
18,340 KB
testcase_11 AC 127 ms
21,524 KB
testcase_12 AC 111 ms
19,244 KB
testcase_13 AC 106 ms
19,108 KB
testcase_14 AC 132 ms
21,920 KB
testcase_15 AC 80 ms
15,388 KB
testcase_16 AC 81 ms
15,412 KB
testcase_17 AC 80 ms
15,380 KB
testcase_18 AC 81 ms
15,536 KB
testcase_19 AC 81 ms
15,344 KB
testcase_20 AC 84 ms
15,736 KB
testcase_21 AC 83 ms
15,764 KB
testcase_22 AC 89 ms
16,904 KB
testcase_23 AC 112 ms
19,556 KB
testcase_24 AC 125 ms
21,036 KB
testcase_25 AC 148 ms
23,464 KB
testcase_26 AC 151 ms
23,524 KB
testcase_27 AC 128 ms
23,248 KB
testcase_28 AC 139 ms
23,484 KB
testcase_29 AC 149 ms
23,628 KB
testcase_30 AC 147 ms
23,200 KB
testcase_31 AC 146 ms
23,048 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

gets
a=gets.split.map{|e| e.to_i}.sort
if (t=a[1]-a[0])>0 then
	i=-1
	puts (a.select{
		i=i+1;
		(i+1<a.size)&&(a[i+1]-a[i]==t)	
	}.count==a.size-1)?"YES":"NO"
else
	puts "NO"
end
0