#include <bits/stdc++.h>
using namespace std;
int mxco = 1e2+5;
signed main(){
ios::sync_with_stdio(0);
cin.tie(0);
int n;
cin >> n;
vector<pair<int,int>>ypex[mxco];
for(int i = 0;i<n;i++){
int x,y;
cin >> x >> y;
ypex[y].push_back({x,i});
}
for(int i = 0;i<mxco;i++){
sort(ypex[i].begin(),ypex[i].end());
}
bool ans[n];
fill(ans,ans+n,0);
for(int i = 0;i<mxco;i++){
if(ypex[i].size()){
ans[ypex[i].front().second]=1;
ans[ypex[i].back().second]=1;
}
}
for(int i = 0;i<n;i++){
cout << ans[i];
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |