結果

問題 No.99 ジャンピング駒
ユーザー scachescache
提出日時 2014-12-09 23:46:11
言語 Java21
(openjdk 21)
結果
AC  
実行時間 635 ms / 5,000 ms
コード長 412 bytes
コンパイル時間 3,607 ms
コンパイル使用メモリ 73,496 KB
実行使用メモリ 60,672 KB
最終ジャッジ日時 2023-09-02 12:23:37
合計ジャッジ時間 8,462 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 635 ms
60,620 KB
testcase_01 AC 629 ms
60,512 KB
testcase_02 AC 619 ms
60,672 KB
testcase_03 AC 599 ms
60,552 KB
testcase_04 AC 596 ms
60,552 KB
testcase_05 AC 598 ms
60,472 KB
権限があれば一括ダウンロードができます

ソースコード

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