This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
#define lln long long
void solve() {
lln n; cin >> n;
vector< pair<lln, lln> > points;
set<lln> xs, ys;
for (lln i=0;i<n;i++) {
lln x, y; cin >> x >> y;
xs.insert(x);
ys.insert(y);
points.push_back(make_pair(x,y));
}
string ans = "1";
if (n==1) {
ans = "1";
}
else if (n==2) {
ans = "11";
}
else if (n==3) {
// cout << xs.size() << " " << ys.size() << '\n';
if (xs.size()==1 && ys.size()==3) {
lln maxy = 0, miny = 0;
for (lln i=0;i<n;i++) {
if (get<1>(points[maxy]) < get<1>(points[i])) maxy = i;
if (get<1>(points[miny]) > get<1>(points[i])) miny = i;
}
ans = "";
for (lln i=0;i<n;i++) {
if (i==maxy || i==miny) ans += "1";
else ans += "0";
}
}
else if (xs.size()==3 && ys.size()==1) {
lln maxx = 0, minx = 0;
for (lln i=0;i<n;i++) {
if (get<0>(points[maxx]) < get<0>(points[i])) maxx = i;
if (get<0>(points[minx]) > get<0>(points[i])) minx = i;
}
ans = "";
for (lln i=0;i<n;i++) {
if (i==maxx || i==minx) ans += "1";
else ans += "0";
}
}
else ans = "111";
}
else ans = "1";
cout << ans << '\n';
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t = 1;
while (t--) solve();
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... |