結果

問題 No.99 ジャンピング駒
ユーザー nksk38nksk38
提出日時 2017-06-19 21:43:29
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 43 ms / 5,000 ms
コード長 486 bytes
コンパイル時間 619 ms
コンパイル使用メモリ 73,516 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-10 06:15:00
合計ジャッジ時間 1,464 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#define _USE_MATH_DEFINES
#include<cstdio>
#include <iostream>
#include<algorithm>
#include<string>
#include<queue>
#include<vector>
#include<functional>
#include<cmath>
#include<map>
#include<stack>
#include<set>
#include<numeric>

using namespace std;
typedef long long ll;
typedef pair<int, int> Pr;

int N;
int g, k;

int main()
{
	cin >> N;
	for (int i = 0; i < N; i++) {
		ll x; cin >> x;
		if (x % 2 == 0)
			g++;
		else
			k++;
	}
	int ans = abs(g - k);

	cout << ans << endl;
}
0