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;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
int n;
cin >> n;
vector<tuple<int, int>> a(n);
for (int i = 0; i < n; i++) {
cin >> get<0>(a[i]) >> get<1>(a[i]);
}
if (n <= 3) {
int x1 = get<0>(a[0]);
int x2 = get<0>(a[1]);
int x3 = get<0>(a[2]);
int y1 = get<1>(a[0]);
int y2 = get<1>(a[1]);
int y3 = get<1>(a[2]);
if (x1 == x2 && x2 == x3) {
int mx = max(y1, y2);
mx = max(mx, y3);
int mn = min(y1, y2);
mn = min(mn, y3);
for (int i = 0; i < n; i++) {
if (get<1>(a[i]) == mx || get<1>(a[i]) == mn) {
cout << 1;
}
else {
cout << 0;
}
}
}
else if (y1 == y2 && y2 == y3) {
int mx = max(x1, x2);
mx = max(mx, x3);
int mn = min(x1, x2);
mn = min(mn, x3);
for (int i = 0; i < n; i++) {
if (get<0>(a[i]) == mx || get<0>(a[i]) == mn) {
cout << 1;
}
else {
cout << 0;
}
}
}
else {
for (int i = 0; i < n; i++) {
cout << 1;
}
}
cout << "\n";
}
}
# | 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... |