結果
| 問題 |
No.99 ジャンピング駒
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-05-29 01:51:22 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 44 ms / 5,000 ms |
| コード長 | 334 bytes |
| コンパイル時間 | 1,237 ms |
| コンパイル使用メモリ | 159,824 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-30 07:58:21 |
| 合計ジャッジ時間 | 2,042 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 6 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
int main(){
int N,in,odd=0,even=0;
vector<int> x;
cin >> N;
while(cin >> in) x.push_back(in);
for(int i=0;i<N;i++) {
if(x[i]%2==0) even++;
else odd++;
}
if(even>odd) cout << even-odd << endl;
else cout << odd-even << endl;
return 0;
}