結果

問題 No.99 ジャンピング駒
ユーザー k_kadorak_kadora
提出日時 2015-05-24 08:48:40
言語 Java21
(openjdk 21)
結果
AC  
実行時間 600 ms / 5,000 ms
コード長 354 bytes
コンパイル時間 4,504 ms
コンパイル使用メモリ 72,120 KB
実行使用メモリ 60,932 KB
最終ジャッジ日時 2023-09-20 11:11:24
合計ジャッジ時間 8,982 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 600 ms
60,836 KB
testcase_01 AC 599 ms
60,820 KB
testcase_02 AC 568 ms
60,596 KB
testcase_03 AC 566 ms
60,452 KB
testcase_04 AC 569 ms
60,656 KB
testcase_05 AC 575 ms
60,932 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
public class Jumping{
	public static void main(String[] arg){
		Scanner sc = new Scanner(System.in);
		int n,ev=0,od=0,temp,count;
		n = sc.nextInt();
		for(int i = 0;i<n;i++){
			temp = Math.abs(sc.nextInt());
			if(temp % 2 == 0){
				ev++;
			}else{
				od++;
			}
		}
		count = Math.abs(ev - od);
		System.out.println(count);
	}
}
0