답안 #757953

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
757953 2023-06-14T02:48:02 Z Dexva Towers (NOI22_towers) C++14
5 / 100
654 ms 53344 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 = "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;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Incorrect 1 ms 212 KB Output isn't correct
12 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 18 ms 2524 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 654 ms 53344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Incorrect 1 ms 212 KB Output isn't correct
12 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Incorrect 1 ms 212 KB Output isn't correct
12 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Incorrect 1 ms 212 KB Output isn't correct
12 Halted 0 ms 0 KB -