# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
757950 |
2023-06-14T02:45:36 Z |
Dexva |
Towers (NOI22_towers) |
C++14 |
|
681 ms |
53200 KB |
#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 = "111";
// 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";
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 |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
16 ms |
2536 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
681 ms |
53200 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |