結果

問題 No.99 ジャンピング駒
ユーザー jimanojimano
提出日時 2018-02-11 17:16:06
言語 Java21
(openjdk 21)
結果
AC  
実行時間 214 ms / 5,000 ms
コード長 568 bytes
コンパイル時間 2,809 ms
コンパイル使用メモリ 73,172 KB
実行使用メモリ 49,880 KB
最終ジャッジ日時 2024-04-28 14:16:36
合計ジャッジ時間 4,777 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 205 ms
49,464 KB
testcase_01 AC 207 ms
48,784 KB
testcase_02 AC 214 ms
49,880 KB
testcase_03 AC 193 ms
49,600 KB
testcase_04 AC 208 ms
49,392 KB
testcase_05 AC 202 ms
49,224 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package me.yukicoder;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class No0099 {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int num = Integer.parseInt(br.readLine());
		String[] str = br.readLine().split(" ");
		int odd = 0;
		int even = 0;

		for (int i = 0; i < num; i++) {
			if (Integer.parseInt(str[i]) % 2 == 0) {
				even++;
			} else {
				odd++;
			}
		}

		System.out.println(Math.abs(even - odd));
	}
}
0