結果
| 問題 |
No.99 ジャンピング駒
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-01-12 22:20:57 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 47 ms / 5,000 ms |
| コード長 | 407 bytes |
| コンパイル時間 | 1,066 ms |
| コンパイル使用メモリ | 91,480 KB |
| 最終ジャッジ日時 | 2025-01-17 17:01:52 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 6 |
ソースコード
#include <algorithm>
#include <array>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <numeric>
#include <optional>
#include <vector>
using namespace std;
int main() {
int32_t n;
cin >> n;
array<int32_t, 2> cnt{};
for (auto i = 0; i < n; ++i) {
int32_t x;
cin >> x;
++cnt[abs(x % 2)];
}
cout << abs(cnt[0] - cnt[1]) << endl;
return 0;
}