結果

問題 No.99 ジャンピング駒
ユーザー m2543315647m2543315647
提出日時 2015-05-14 11:02:37
言語 Java21
(openjdk 21)
結果
AC  
実行時間 627 ms / 5,000 ms
コード長 304 bytes
コンパイル時間 3,344 ms
コンパイル使用メモリ 72,556 KB
実行使用メモリ 62,540 KB
最終ジャッジ日時 2023-09-20 07:41:34
合計ジャッジ時間 8,223 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 621 ms
60,848 KB
testcase_01 AC 627 ms
60,372 KB
testcase_02 AC 599 ms
60,708 KB
testcase_03 AC 588 ms
60,544 KB
testcase_04 AC 592 ms
62,540 KB
testcase_05 AC 607 ms
60,704 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
public class No99 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int even = 0, odd = 0;
		int n = sc.nextInt();
		for (int i = 0; i < n; i++)
			if (sc.nextInt() % 2 == 0)even++;
			else odd++;
		System.out.println(Math.abs(even-odd));
	}
}
0