結果

問題 No.99 ジャンピング駒
ユーザー m2543315647
提出日時 2015-05-14 11:02:37
言語 Java
(openjdk 23)
結果
AC  
実行時間 554 ms / 5,000 ms
コード長 304 bytes
コンパイル時間 2,783 ms
コンパイル使用メモリ 74,968 KB
実行使用メモリ 48,524 KB
最終ジャッジ日時 2024-07-06 03:35:52
合計ジャッジ時間 7,132 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
public class No99 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int even = 0, odd = 0;
		int n = sc.nextInt();
		for (int i = 0; i < n; i++)
			if (sc.nextInt() % 2 == 0)even++;
			else odd++;
		System.out.println(Math.abs(even-odd));
	}
}
0