結果

問題 No.99 ジャンピング駒
ユーザー ffmm00ffmm00
提出日時 2015-06-20 01:16:23
言語 Java21
(openjdk 21)
結果
AC  
実行時間 570 ms / 5,000 ms
コード長 344 bytes
コンパイル時間 3,974 ms
コンパイル使用メモリ 73,372 KB
実行使用メモリ 62,628 KB
最終ジャッジ日時 2023-09-21 10:28:27
合計ジャッジ時間 8,608 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 570 ms
62,628 KB
testcase_01 AC 554 ms
58,340 KB
testcase_02 AC 563 ms
60,452 KB
testcase_03 AC 568 ms
60,848 KB
testcase_04 AC 569 ms
60,596 KB
testcase_05 AC 560 ms
60,748 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class N99 {

	public static void main(String[] args) {

		Scanner sca = new Scanner(System.in);
		int n = sca.nextInt();
		int[] a = new int[n];
		int A = 0;

		for (int i = 0; i < n; i++) {
			a[i] = sca.nextInt();
			if (a[i] % 2 == 0)
				A++;
			else
				A--;
		}

		System.out.println(Math.abs(A));

	}

}
0