結果

問題 No.99 ジャンピング駒
ユーザー kenji_shioya
提出日時 2016-06-27 05:02:42
言語 Java
(openjdk 23)
結果
AC  
実行時間 708 ms / 5,000 ms
コード長 367 bytes
コンパイル時間 3,398 ms
コンパイル使用メモリ 74,468 KB
実行使用メモリ 59,396 KB
最終ジャッジ日時 2024-10-11 22:21:26
合計ジャッジ時間 9,294 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Exercise130{
  public static void main (String[] args){

    Scanner sc = new Scanner(System.in);

    int n = sc.nextInt();
    int even = 0;
    int odd = 0;
    for(int i = 0; i < n; i++){
      if(sc.nextInt() % 2 == 0){
        even++;
      }else{
        odd++;
      }
    }
    System.out.println(Math.abs(even - odd));
	}
}
0