結果

問題 No.99 ジャンピング駒
ユーザー Pictogram1010Pictogram1010
提出日時 2016-07-20 15:16:41
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 45 ms / 5,000 ms
コード長 309 bytes
コンパイル時間 419 ms
コンパイル使用メモリ 55,348 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-23 17:03:48
合計ジャッジ時間 1,199 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<iostream>
#include<cstdlib>

using namespace std;

int main()
{
	int N;
	cin >> N;

	long int* X;
	X = new long int[N];

	int oddNcnt = 0, evenNcnt = 0;
	for (int i = 0; i < N; i++){
		cin >> X[i];
		if (X[i] % 2 == 0)
			evenNcnt++;
		else
			oddNcnt++;
	}

	cout << abs(evenNcnt-oddNcnt) << endl;
}
0