結果

問題 No.99 ジャンピング駒
ユーザー hotpepsihotpepsi
提出日時 2014-12-10 00:58:16
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 34 ms / 5,000 ms
コード長 387 bytes
コンパイル時間 728 ms
コンパイル使用メモリ 65,056 KB
実行使用メモリ 5,416 KB
最終ジャッジ日時 2023-09-02 12:28:13
合計ジャッジ時間 1,685 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
5,416 KB
testcase_01 AC 33 ms
5,416 KB
testcase_02 AC 34 ms
5,304 KB
testcase_03 AC 33 ms
5,308 KB
testcase_04 AC 33 ms
5,400 KB
testcase_05 AC 33 ms
5,336 KB
権限があれば一括ダウンロードができます

ソースコード

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