結果

問題 No.99 ジャンピング駒
ユーザー tsunabittsunabit
提出日時 2019-05-05 17:47:22
言語 Java21
(openjdk 21)
結果
AC  
実行時間 591 ms / 5,000 ms
コード長 551 bytes
コンパイル時間 3,438 ms
コンパイル使用メモリ 74,420 KB
実行使用メモリ 61,004 KB
最終ジャッジ日時 2023-09-07 12:32:37
合計ジャッジ時間 7,941 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 590 ms
60,580 KB
testcase_01 AC 581 ms
60,496 KB
testcase_02 AC 591 ms
60,764 KB
testcase_03 AC 575 ms
60,676 KB
testcase_04 AC 574 ms
61,004 KB
testcase_05 AC 556 ms
60,896 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class No99 {
    public static void main(String[] args) {
        // 標準入力から読み込む際に、Scannerオブジェクトを使う。
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int temp = 0;
        int count = 0;
        for(int i = 0 ; i < n ; i++) {
            temp = sc.nextInt();
            if(temp % 2 == 0) {
                count++;
            }else {
                count--;
            }
        }
        System.out.println(Math.abs(count));
    }
}
0