結果
問題 |
No.99 ジャンピング駒
|
ユーザー |
![]() |
提出日時 | 2016-01-02 08:57:18 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 214 ms / 5,000 ms |
コード長 | 548 bytes |
コンパイル時間 | 2,330 ms |
コンパイル使用メモリ | 75,232 KB |
実行使用メモリ | 50,256 KB |
最終ジャッジ日時 | 2024-09-19 09:38:50 |
合計ジャッジ時間 | 3,911 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 6 |
ソースコード
import java.io.*; import java.util.*; class Main99 { public static void out (Object o) { System.out.println(o); } public static void main (String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int cnt1 = 0 , cnt2 = 0; int n = Integer.parseInt(br.readLine()); String[] line = br.readLine().split(" "); for (int i = 0; i < n; i++) { int m = Integer.parseInt(line[i]); if (m % 2 == 0) cnt1++; else cnt2++; } out(Math.abs(cnt1 - cnt2)); } }