結果

問題 No.99 ジャンピング駒
ユーザー hoktohokto
提出日時 2018-12-20 17:35:37
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 274 bytes
コンパイル時間 67 ms
コンパイル使用メモリ 11,980 KB
実行使用メモリ 24,148 KB
最終ジャッジ日時 2023-10-26 01:06:08
合計ジャッジ時間 1,798 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:1: warning: assigned but unused variable - number
Syntax OK

ソースコード

diff #

number=gets.to_i
point_cnt=gets.chomp
point=point_cnt.split.map(&:to_i)
even_dis=0
odd_dis=0
(point.size-1).times do|i|
if(point[i]+point[i+1])%2==1
	odd_dis+=1
else
	even_dis+=1
end
end
if odd_dis>even_dis
print (odd_dis-(even_dis+1))
else
	print (even_dis-(odd_dis+1))
end
0