結果
問題 | No.99 ジャンピング駒 |
ユーザー |
|
提出日時 | 2024-09-27 18:33:38 |
言語 | C++17(gcc12) (gcc 12.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 38 ms / 5,000 ms |
コード長 | 383 bytes |
コンパイル時間 | 2,359 ms |
コンパイル使用メモリ | 199,600 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-27 18:33:42 |
合計ジャッジ時間 | 3,731 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 6 |
ソースコード
#include <bits/stdc++.h>using namespace std;using ll = long long;#define rep(i, s, e) for (int i = (int)s; i < (int)e; i++)int main() {cin.tie(nullptr);int N;cin >> N;int even = 0, odd = 0;rep(i, 0, N) {int X;cin >> X;if (X % 2 == 0) even++;else odd++;}cout << abs(even - odd) << '\n';}