結果
| 問題 |
No.99 ジャンピング駒
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-03-31 16:10:50 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 45 ms / 5,000 ms |
| コード長 | 448 bytes |
| コンパイル時間 | 740 ms |
| コンパイル使用メモリ | 63,992 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-02 08:29:22 |
| 合計ジャッジ時間 | 1,615 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 6 |
ソースコード
#include <iostream>
#include <vector>
#include <cmath>
using namespace std;
int main() {
int n, x, even, odd;
even = 0; odd = 0;
cin >> n;
vector<int> numKoma;
for (int i = 0; i < n; ++i) {
cin >> x;
numKoma.push_back(x);
}
for (auto itr = numKoma.begin(); itr != numKoma.end(); ++itr) {
if (*itr % 2 == 0) even++;
else odd++;
}
cout << abs(even - odd) << endl;
return 0;
}