結果
| 問題 | No.99 ジャンピング駒 |
| コンテスト | |
| ユーザー |
takeya_okino
|
| 提出日時 | 2017-06-22 22:32:35 |
| 言語 | Java (openjdk 26.0.2.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 374 ms / 5,000 ms |
| + 127µs | |
| コード長 | 388 bytes |
| 記録 | |
| コンパイル時間 | 1,302 ms |
| コンパイル使用メモリ | 85,784 KB |
| 実行使用メモリ | 51,480 KB |
| 最終ジャッジ日時 | 2026-09-08 22:50:39 |
| 合計ジャッジ時間 | 5,570 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 6 |
ソースコード
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int odd = 0;
int even = 0;
for(int i = 0; i < N; i++) {
int x = sc.nextInt();
if(x % 2 == 0) {
even++;
} else {
odd++;
}
}
System.out.println(N - 2 * Math.min(even, odd));
}
}
takeya_okino