結果

問題 No.99 ジャンピング駒
ユーザー chiho_miyako
提出日時 2015-04-11 22:20:46
言語 Java
(openjdk 23)
結果
AC  
実行時間 663 ms / 5,000 ms
コード長 472 bytes
コンパイル時間 1,907 ms
コンパイル使用メモリ 75,144 KB
実行使用メモリ 49,124 KB
最終ジャッジ日時 2024-07-04 13:39:17
合計ジャッジ時間 6,894 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner koko = new Scanner(System.in);
        int n = koko.nextInt();
        int[] x = new int[n];
        int count=0;
        for(int i=0; i<n; i++){
            x[i] = koko.nextInt();
            if(x[i]%2==0){
                count++;
            }else{
                count--;
            }
        }
        System.out.println(Math.abs(count));
    }
}
0