結果

問題 No.99 ジャンピング駒
ユーザー chiho_miyakochiho_miyako
提出日時 2015-04-11 22:20:46
言語 Java21
(openjdk 21)
結果
AC  
実行時間 610 ms / 5,000 ms
コード長 472 bytes
コンパイル時間 1,960 ms
コンパイル使用メモリ 71,356 KB
実行使用メモリ 60,924 KB
最終ジャッジ日時 2023-09-17 19:18:46
合計ジャッジ時間 6,688 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 610 ms
60,608 KB
testcase_01 AC 608 ms
60,692 KB
testcase_02 AC 607 ms
60,484 KB
testcase_03 AC 580 ms
60,852 KB
testcase_04 AC 580 ms
60,924 KB
testcase_05 AC 578 ms
60,656 KB
権限があれば一括ダウンロードができます

ソースコード

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