이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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... |