結果

問題 No.99 ジャンピング駒
ユーザー tsunabittsunabit
提出日時 2019-05-05 17:44:01
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 540 bytes
コンパイル時間 4,393 ms
コンパイル使用メモリ 79,960 KB
実行使用メモリ 60,580 KB
最終ジャッジ日時 2023-09-07 12:30:59
合計ジャッジ時間 9,176 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 594 ms
60,580 KB
testcase_01 AC 603 ms
60,412 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 584 ms
60,528 KB
testcase_05 WA -
権限があれば一括ダウンロードができます

ソースコード

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(count);
    }
}
0