結果

問題 No.99 ジャンピング駒
ユーザー Tsukasa_Type
提出日時 2018-02-12 00:28:46
言語 Java
(openjdk 23)
結果
AC  
実行時間 682 ms / 5,000 ms
コード長 325 bytes
コンパイル時間 2,614 ms
コンパイル使用メモリ 83,504 KB
実行使用メモリ 48,296 KB
最終ジャッジ日時 2024-11-21 15:15:26
合計ジャッジ時間 7,383 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

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