結果
| 問題 |
No.99 ジャンピング駒
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-06-26 00:24:15 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 626 bytes |
| コンパイル時間 | 1,695 ms |
| コンパイル使用メモリ | 174,960 KB |
| 実行使用メモリ | 10,912 KB |
| 最終ジャッジ日時 | 2024-07-03 22:03:41 |
| 合計ジャッジ時間 | 10,505 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 3 TLE * 1 -- * 2 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define all(x) (x).begin(),(x).end()
int main(){
int n; cin>>n;
vector<pair<int,int>> vp(n);
rep(i,n){
int x; cin>>x;
vp[i]=make_pair(x,1);
}
sort(all(vp));
bool flg=true;
while(flg){
flg=false;
for(int i=0; i<n; i++){
if(vp[i].second==0) continue;
for(int j=i+1; j<n; j++){
if(vp[j].second==0) continue;
if((vp[j].first-vp[i].first)%2==1){
vp[j].second=0;
vp[i].second=0;
flg=true;
break;
}
}
}
}
int ans=0;
for(auto x:vp){
if(x.second==1) ans++;
}
cout << ans << endl;
}