結果

問題 No.99 ジャンピング駒
ユーザー chacoder1
提出日時 2021-02-18 20:37:07
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 49 ms / 5,000 ms
コード長 313 bytes
コンパイル時間 1,827 ms
コンパイル使用メモリ 191,536 KB
最終ジャッジ日時 2025-01-18 22:36:34
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<n;i++)

int main(){
  int n;
  cin>>n;
  int a[n];
  int ev=0;
  int od=0;
  rep(i,n){
    cin>>a[i];
    if(a[i]%2==0){
      ev++;
    }
    else{
      od++;
    }
  }
  cout<<abs(ev-od)<<endl;
  
  return 0;
}
0