結果

問題 No.99 ジャンピング駒
ユーザー Tsukasa_TypeTsukasa_Type
提出日時 2018-02-12 00:28:46
言語 Java21
(openjdk 21)
結果
AC  
実行時間 682 ms / 5,000 ms
コード長 325 bytes
コンパイル時間 2,340 ms
コンパイル使用メモリ 74,288 KB
実行使用メモリ 59,600 KB
最終ジャッジ日時 2024-05-01 11:19:27
合計ジャッジ時間 7,769 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 659 ms
59,088 KB
testcase_01 AC 672 ms
59,256 KB
testcase_02 AC 682 ms
59,440 KB
testcase_03 AC 669 ms
59,336 KB
testcase_04 AC 674 ms
59,600 KB
testcase_05 AC 648 ms
59,532 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

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