結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 832 ms
24,940 KB
testcase_01 AC 840 ms
24,940 KB
testcase_02 AC 858 ms
24,940 KB
testcase_03 AC 658 ms
24,940 KB
testcase_04 AC 176 ms
24,940 KB
testcase_05 AC 172 ms
24,940 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

numb_input=gets.to_i
count=numb_input.to_i
point_input=gets.chomp
point=point_input.split.map(&:to_i)
point.sort!
flag=true
begin
	flag=true
	current_pos=0.to_i
	while(current_pos.to_i <point.size.to_i-1)
		if (point[current_pos].to_i+point[current_pos+1].to_i)%2==1
			flag=false
			point.delete_at(current_pos)
			point.delete_at(current_pos)
			count-=2
		else
			current_pos+=1.to_i
		end
	end
end while !flag&&count >1
print count
0