結果

問題 No.99 ジャンピング駒
ユーザー kohaku_kohakukohaku_kohaku
提出日時 2016-11-14 00:56:32
言語 Java21
(openjdk 21)
結果
AC  
実行時間 623 ms / 5,000 ms
コード長 395 bytes
コンパイル時間 3,898 ms
コンパイル使用メモリ 71,296 KB
実行使用メモリ 60,856 KB
最終ジャッジ日時 2023-08-17 04:31:22
合計ジャッジ時間 8,299 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 623 ms
60,856 KB
testcase_01 AC 616 ms
60,520 KB
testcase_02 AC 614 ms
60,748 KB
testcase_03 AC 592 ms
60,696 KB
testcase_04 AC 594 ms
60,692 KB
testcase_05 AC 588 ms
60,352 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int odd =0;
        int even=0;
        for(int i=0; i<N; i++){
            int X = sc.nextInt();
            if(X%2==0){even++;}else{odd++;}
        }
        int r = Math.abs(odd-even);
        System.out.println(r);
    }
}
0