結果

問題 No.99 ジャンピング駒
ユーザー hotpepsi
提出日時 2014-12-10 00:58:16
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 37 ms / 5,000 ms
コード長 387 bytes
コンパイル時間 649 ms
コンパイル使用メモリ 64,620 KB
実行使用メモリ 5,524 KB
最終ジャッジ日時 2024-06-11 19:09:05
合計ジャッジ時間 1,391 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <sstream>
#include <cmath>

using namespace std;

int main(int argc, char *argv[])
{
	string s;
	getline(cin, s);
	int N = atoi(s.c_str());
	getline(cin, s);
	stringstream ss(s);
	int a[2] = {};
	for (int i = 0; i < N; ++i) {
		int b;
		ss >> b;
		a[b & 1] += 1;
	}
	cout << abs(a[0] - a[1]) << endl;
	return 0;
}
0