結果

問題 No.99 ジャンピング駒
ユーザー chacoder1chacoder1
提出日時 2021-02-18 20:37:07
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 41 ms / 5,000 ms
コード長 313 bytes
コンパイル時間 2,744 ms
コンパイル使用メモリ 196,792 KB
実行使用メモリ 4,376 KB
最終ジャッジ日時 2023-10-13 04:07:08
合計ジャッジ時間 2,989 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
4,372 KB
testcase_01 AC 41 ms
4,372 KB
testcase_02 AC 40 ms
4,372 KB
testcase_03 AC 40 ms
4,376 KB
testcase_04 AC 40 ms
4,372 KB
testcase_05 AC 40 ms
4,368 KB
権限があれば一括ダウンロードができます

ソースコード

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