結果

問題 No.99 ジャンピング駒
ユーザー shinwisteria
提出日時 2019-01-23 19:52:44
言語 Java
(openjdk 23)
結果
AC  
実行時間 725 ms / 5,000 ms
コード長 334 bytes
コンパイル時間 3,666 ms
コンパイル使用メモリ 74,904 KB
実行使用メモリ 60,128 KB
最終ジャッジ日時 2024-09-16 04:29:12
合計ジャッジ時間 8,808 ms
ジャッジサーバーID
(参考情報)
judge2 / judge6
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
public class No99 {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int n = s.nextInt() , k = 0;
		s.nextLine();
		for(int i = 0;i < n;i++){
			if(Math.abs(s.nextInt() % 2) == 1){
				k++;
			}else{
				k--;
			}
		}
		s.close();

		System.out.println(Math.abs(k));

	}

}
0