結果

問題 No.99 ジャンピング駒
ユーザー htensai
提出日時 2019-12-05 18:08:39
言語 Java
(openjdk 23)
結果
AC  
実行時間 720 ms / 5,000 ms
コード長 349 bytes
コンパイル時間 2,606 ms
コンパイル使用メモリ 74,060 KB
実行使用メモリ 59,516 KB
最終ジャッジ日時 2024-12-21 12:54:43
合計ジャッジ時間 8,118 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

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

0