結果

問題 No.99 ジャンピング駒
ユーザー nCk_cv
提出日時 2016-01-29 16:55:24
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 448 bytes
コンパイル時間 2,044 ms
コンパイル使用メモリ 81,244 KB
実行使用メモリ 61,232 KB
最終ジャッジ日時 2024-09-21 17:52:26
合計ジャッジ時間 7,312 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 4 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.math.*;
import java.io.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int a = 0;
		int b = 0;
		ArrayList<Integer> list = new ArrayList<Integer>();
		for(int i = 0; i < N; i++) {
			if(sc.nextInt() % 2 == 0) a++;
			else b++;
		}
		if(a == 0 || b == 0) System.out.println(0);
		else {
			System.out.println(Math.abs(a- b));
		}
	}
}
0