結果

問題 No.99 ジャンピング駒
ユーザー k_kadora
提出日時 2015-05-24 08:48:40
言語 Java
(openjdk 23)
結果
AC  
実行時間 583 ms / 5,000 ms
コード長 354 bytes
コンパイル時間 3,152 ms
コンパイル使用メモリ 74,820 KB
実行使用メモリ 48,048 KB
最終ジャッジ日時 2024-07-06 06:38:06
合計ジャッジ時間 7,261 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
public class Jumping{
	public static void main(String[] arg){
		Scanner sc = new Scanner(System.in);
		int n,ev=0,od=0,temp,count;
		n = sc.nextInt();
		for(int i = 0;i<n;i++){
			temp = Math.abs(sc.nextInt());
			if(temp % 2 == 0){
				ev++;
			}else{
				od++;
			}
		}
		count = Math.abs(ev - od);
		System.out.println(count);
	}
}
0