結果
問題 | No.99 ジャンピング駒 |
ユーザー |
![]() |
提出日時 | 2018-12-20 17:11:16 |
言語 | Ruby (3.4.1) |
結果 |
AC
|
実行時間 | 838 ms / 5,000 ms |
コード長 | 435 bytes |
コンパイル時間 | 275 ms |
コンパイル使用メモリ | 7,424 KB |
実行使用メモリ | 21,248 KB |
最終ジャッジ日時 | 2024-09-25 09:06:03 |
合計ジャッジ時間 | 5,086 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 6 |
コンパイルメッセージ
Syntax OK
ソースコード
numb_input=gets.to_icount=numb_input.to_ipoint_input=gets.chomppoint=point_input.split.map(&:to_i)point.sort!flag=truebeginflag=truecurrent_pos=0.to_iwhile(current_pos.to_i <point.size.to_i-1)if (point[current_pos].to_i+point[current_pos+1].to_i)%2==1flag=falsepoint.delete_at(current_pos)point.delete_at(current_pos)count-=2elsecurrent_pos+=1.to_iendendend while !flag&&count >1print count