Submission #757969

#TimeUsernameProblemLanguageResultExecution timeMemory
757969gelovTowers (NOI22_towers)C++17
5 / 100
160 ms8148 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...