結果

問題 No.99 ジャンピング駒
ユーザー scachescache
提出日時 2014-12-09 23:46:11
言語 Java
(openjdk 23)
結果
AC  
実行時間 607 ms / 5,000 ms
コード長 412 bytes
コンパイル時間 2,875 ms
コンパイル使用メモリ 75,576 KB
実行使用メモリ 59,696 KB
最終ジャッジ日時 2024-06-11 19:05:09
合計ジャッジ時間 7,213 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main99 {
	public static void main(String[] args) {
		Main99 p = new Main99();
	}

	public Main99() {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] s = new int[2];
		for (int i = 0; i < n; i++)
			s[Math.abs(sc.nextInt())%2] += 1;
		
		System.out.println(s[0]==s[1] ? 0 : Math.max(s[0], s[1])-Math.min(s[0], s[1]));
		
	}


}
0