結果
問題 | No.99 ジャンピング駒 |
ユーザー |
![]() |
提出日時 | 2016-07-09 17:02:48 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 592 ms / 5,000 ms |
コード長 | 314 bytes |
コンパイル時間 | 3,498 ms |
コンパイル使用メモリ | 74,052 KB |
実行使用メモリ | 48,416 KB |
最終ジャッジ日時 | 2024-10-13 09:36:31 |
合計ジャッジ時間 | 8,207 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 6 |
ソースコード
import java.util.Scanner;class Main{public static void main(String[] args) {Scanner sc=new Scanner(System.in);while(sc.hasNext()){int n=sc.nextInt();int o=0,e=0;for(int i=0;i<n;i++){int x=sc.nextInt();if(x%2==0) e++;else o++;}System.out.println(Math.abs(o-e));}}}