結果

問題 No.99 ジャンピング駒
ユーザー tsunabit
提出日時 2019-05-05 17:47:22
言語 Java
(openjdk 23)
結果
AC  
実行時間 638 ms / 5,000 ms
コード長 551 bytes
コンパイル時間 3,898 ms
コンパイル使用メモリ 74,372 KB
実行使用メモリ 48,292 KB
最終ジャッジ日時 2024-06-25 06:37:10
合計ジャッジ時間 9,053 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 6
権限があれば一括ダウンロードができます

ソースコード

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