結果

問題 No.99 ジャンピング駒
ユーザー ibuki2003ibuki2003
提出日時 2017-09-30 16:26:57
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 44 ms / 5,000 ms
コード長 494 bytes
コンパイル時間 1,486 ms
コンパイル使用メモリ 166,448 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-27 16:56:24
合計ジャッジ時間 2,369 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

#define REP(i, n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define REP3(i, m, n) for(int i = m, i##_len=(n);i < i##_len;i++)
#define FORVEC(i, v) for(int i = 0;i < v.size();i++)

#define INF 1000000000
#define pb(a) push_back(a)
#define llong long long

int main(){
	int n;
	int k=0,g=0;
	int buf;
	cin>>n;
	REP(i,n){
		cin>>buf;
		if(buf%2==0)k++;
		else g++;
	}
	cout<<abs(k-g)<<endl;
	return 0;
}
0