結果

問題 No.99 ジャンピング駒
ユーザー 37zigen37zigen
提出日時 2016-03-12 20:18:09
言語 Java21
(openjdk 21)
結果
AC  
実行時間 620 ms / 5,000 ms
コード長 572 bytes
コンパイル時間 3,363 ms
コンパイル使用メモリ 77,368 KB
実行使用メモリ 63,972 KB
最終ジャッジ日時 2023-10-25 08:11:47
合計ジャッジ時間 8,055 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 551 ms
63,924 KB
testcase_01 AC 589 ms
63,972 KB
testcase_02 AC 596 ms
63,896 KB
testcase_03 AC 584 ms
63,928 KB
testcase_04 AC 593 ms
63,916 KB
testcase_05 AC 620 ms
61,960 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package 練習;
import java.util.Date;
import java.util.Scanner;

public class main{
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		long exec_time=new Date().getTime();
		int n=sc.nextInt();
		int odd=0;
		int even=0;
		for(int i=0;i<n;i++){
			int x=sc.nextInt();
			if(Math.abs(x)%2==0){
				even++;
			}else if(Math.abs(x)%2==1){
				odd++;
			}else{
				System.err.println("Error");
				System.err.println("x%2="+x%2);
			}
		}
		System.out.println(Math.abs(even-odd));
		System.err.println(new Date().getTime()-exec_time+"ms");
	}
}

0