結果

問題 No.99 ジャンピング駒
ユーザー kano_townkano_town
提出日時 2014-12-09 23:51:20
言語 Java
(openjdk 23)
結果
AC  
実行時間 675 ms / 5,000 ms
コード長 345 bytes
コンパイル時間 4,197 ms
コンパイル使用メモリ 74,508 KB
実行使用メモリ 49,296 KB
最終ジャッジ日時 2024-06-11 19:07:21
合計ジャッジ時間 8,656 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Yukicoder99 {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int odd = 0, even = 0;

		for (int i = 0; i < n; i++) {
			if (sc.nextInt() % 2 == 0) even++;
			else odd++;
		}

		System.out.println(Math.abs(odd - even));;

	}
}
0