結果
問題 | No.99 ジャンピング駒 |
ユーザー |
![]() |
提出日時 | 2015-11-01 10:46:45 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 44 ms / 5,000 ms |
コード長 | 371 bytes |
コンパイル時間 | 441 ms |
コンパイル使用メモリ | 61,484 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-13 06:50:15 |
合計ジャッジ時間 | 1,701 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 6 |
ソースコード
#include<iostream>#include<stdio.h>#include<vector>#include<algorithm>using namespace std;int main(){int n;cin>> n;vector<int> vec(n);int cnt=0;for(int i=0; i<n; i++){cin>> vec[i];if(vec[i]%2==0){cnt++;}else{cnt--;}}cout<< max(cnt, -cnt)<< endl;return 0;}