結果

問題 No.99 ジャンピング駒
ユーザー GrenacheGrenache
提出日時 2015-09-23 19:51:19
言語 Java21
(openjdk 21)
結果
AC  
実行時間 607 ms / 5,000 ms
コード長 483 bytes
コンパイル時間 4,705 ms
コンパイル使用メモリ 71,612 KB
実行使用メモリ 60,596 KB
最終ジャッジ日時 2023-09-26 14:38:09
合計ジャッジ時間 9,645 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 599 ms
60,532 KB
testcase_01 AC 607 ms
60,292 KB
testcase_02 AC 591 ms
60,596 KB
testcase_03 AC 574 ms
60,468 KB
testcase_04 AC 595 ms
60,304 KB
testcase_05 AC 569 ms
60,272 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;


public class Main_yukicoder99 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int odd = 0;
        int even = 0;
        for (int i = 0; i < n; i++) {
        	int x = sc.nextInt();
        	if (x % 2 == 0) {
        		even++;
        	} else {
        		odd++;
        	}
        }

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