結果

問題 No.99 ジャンピング駒
ユーザー chakkuchakku
提出日時 2015-09-26 02:45:57
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 41 ms / 5,000 ms
コード長 527 bytes
コンパイル時間 472 ms
コンパイル使用メモリ 65,964 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-26 16:27:00
合計ジャッジ時間 1,536 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <queue>
#include <string>
#include <climits>
using namespace std;

#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,x,n) for(int i=x;i<n;i++)
#define ALL(x) (x).begin(),(x).end()
#define debug(x) cout<<#x<<":"<<x<<endl
const int INF = INT_MAX / 3;

int main(){
	int N; cin >> N;
	int even = 0, odd = 0;
	int x[10001];
	rep(i, N){
		int xx; cin >> xx;
		if (xx % 2 == 0) even++;
		else odd++;
	}
	cout << abs(even - odd) << endl;
	return 0;
}
0