結果
問題 | No.99 ジャンピング駒 |
ユーザー |
![]() |
提出日時 | 2023-04-14 21:25:40 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 45 ms / 5,000 ms |
コード長 | 304 bytes |
コンパイル時間 | 621 ms |
コンパイル使用メモリ | 68,124 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-10 12:08:29 |
合計ジャッジ時間 | 1,472 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 6 |
ソースコード
#include<iostream> #include<cmath> using namespace std; int main() { int n; cin >> n; int odd = 0, even = 0; for (int i = 0; i < n; i++) { int x; cin >> x; if (abs(x) % 2 == 0) even++; else odd++; } cout << abs(odd - even) << endl; return 0; }