結果

問題 No.99 ジャンピング駒
ユーザー toshiro_yanagi
提出日時 2019-01-12 08:13:05
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 45 ms / 5,000 ms
コード長 264 bytes
コンパイル時間 729 ms
コンパイル使用メモリ 63,616 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-16 04:16:12
合計ジャッジ時間 2,213 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

// c++ cpp.cpp -o cpp.exe -std =c++14

#include <iostream>
using namespace std;

int main()
{
	int n, a[2];
	cin >> n;
	a[0] = 0;
	a[1] = 0;

	for (int i = 0; i < n; i++)
	{
		int x;
		cin >> x;
		a[(int)(x + 1e9) % 2] += 1;
	}
	cout << abs(a[0] - a[1]) << endl;
}
0