結果
問題 | No.99 ジャンピング駒 |
ユーザー |
![]() |
提出日時 | 2016-05-01 05:59:49 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 42 ms / 5,000 ms |
コード長 | 465 bytes |
コンパイル時間 | 659 ms |
コンパイル使用メモリ | 70,280 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-05 00:27:57 |
合計ジャッジ時間 | 1,501 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 6 |
ソースコード
#include <algorithm>#include <iostream>#include <map>#include <numeric>#include <set>#include <sstream>#include <string>#include <vector>#include <cmath>using namespace std;int main() {int N;cin >> N;int odd = 0;int even = 0;for (int i=0;i < N;i++){int t;cin >> t;if (t%2 == 0){even++;}else{odd++;}}int ans;if (even - odd >= 0){ans = even - odd;}else{ans = odd - even;}cout << ans << endl;return 0;}