結果
| 問題 |
No.99 ジャンピング駒
|
| コンテスト | |
| ユーザー |
machy
|
| 提出日時 | 2015-06-11 20:12:52 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 40 ms / 5,000 ms |
| コード長 | 518 bytes |
| コンパイル時間 | 511 ms |
| コンパイル使用メモリ | 71,424 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-06 15:43:43 |
| 合計ジャッジ時間 | 1,742 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 6 |
ソースコード
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
#include <iomanip>
using namespace std;
typedef long long LL;
int main(){
int N;
cin >> N;
int cnt[2] = {0,0};
for(int i = 0; i < N; i++){
int x;
cin >> x;
if(x % 2 == 0){
cnt[0]++;
}else{
cnt[1]++;
}
}
if(cnt[0] > cnt[1]){
cout << cnt[0]-cnt[1] << endl;
}else{
cout << cnt[1]-cnt[0] << endl;
}
return 0;
}
machy