結果
| 問題 | 
                            No.99 ジャンピング駒
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2020-09-18 12:37:20 | 
| 言語 | C++14  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 40 ms / 5,000 ms | 
| コード長 | 333 bytes | 
| コンパイル時間 | 485 ms | 
| コンパイル使用メモリ | 67,656 KB | 
| 実行使用メモリ | 6,944 KB | 
| 最終ジャッジ日時 | 2024-06-22 07:56:03 | 
| 合計ジャッジ時間 | 1,259 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 6 | 
ソースコード
#include<iostream>
#include<cmath>
#define MAX_N 100050
using namespace std;
int N;
int x[MAX_N];
int main(){
    cin >> N;
    int odd = 0,even = 0;
    for(int i=0;i < N;i++){
        cin >> x[i];
        if(x[i] % 2 == 0) even++;
        else odd++;
    }
    int ans = abs(odd - even);
    cout << ans << endl;
    return 0;
}