結果

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

テストケース

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

ソースコード

diff #

gets
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
answer=(odd_dis-(even_dis+1))
else
answer=(even_dis-(odd_dis+1))
end
print answer
0