結果
問題 | No.99 ジャンピング駒 |
ユーザー |
![]() |
提出日時 | 2014-12-09 23:28:15 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 39 ms / 5,000 ms |
コード長 | 440 bytes |
コンパイル時間 | 496 ms |
コンパイル使用メモリ | 72,088 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-11 19:00:18 |
合計ジャッジ時間 | 1,240 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 6 |
ソースコード
#include <iostream>#include <vector>#include <cstdio>#include <sstream>#include <map>#include <string>#include <algorithm>#include <queue>#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 x;cin >> x;if( x%2 == 0 ) even++;else odd++;}int ans = max(even, odd) - min(even, odd);cout << ans << endl;return 0;}