#include <bits/stdc++.h>   #pragma GCC optimize( O3 )   #pragma GCC optimize( Ofast )   #pragma GCC optimize( unroll-loops )   using namespace std;   signed main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     int i, n, m;     cin >> n >> m;     vector<int> a(n + m);     for (i = 0; i < n + m; i++) {       cin >> a[i];     }     set<int> tax, per;     for (i = 0; i < n + m; i++) {       int t;       cin >> t;       if (t == 0) {         per.insert(a[i]);       } else {         tax.insert(a[i]);       }     }     map<int, int> ans;     for (auto cur : per) {       auto right = tax.upper_bound(cur);       auto left = --tax.upper_bound(cur);       if (left == tax.end()) {         ans[*right]++;       } else if (right == tax.end()) {         ans[*left]++;       } else {         int l = *left, r = *right;         if (cur - l <= r - cur) {           ans[l]++;         } else {           ans[r]++;         }       }     }     for (auto cur : tax) {       cout << ans[cur] <<    ;     }     return 0;   }   