Submission #1002982

# Submission time Handle Problem Language Result Execution time Memory
1002982 2024-06-19T21:51:57 Z mariaclara Izvanzemaljci (COI21_izvanzemaljci) C++17
Compilation error
0 ms 0 KB
#include<bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
const int MAXN = 1e5+5;
#define all(x) x.begin(), x.end()
#define sz(x) (int)x.size()
#define pb push_back
#define fr first
#define sc second

int n, k;
pii p[MAXN];
int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);

    cin >> n >> k;

    for(int i = 1; i <= n; i++) cin >> p[i].fr >> p[i].sc;

    if(k == 1) {
        int a, b, c, d;
        for(int i = 1; i <= n; i++) {
            a = min(a, p[i].fr);
            b = min(b, p[i].sc);
            c = max(c, p[i].fr);
            d = max(d, p[i].sc);
        }

        if(n == 1) cout << a << " " << b << " 1\n";
        else cout << a << " " << b << max(c-a, d-b) << "\n";
    }
    if(k == 2) {
        vector<pii> v;
        for(int i = 1; i <= n; i++) v.pb(p[i]);

        vector<int> ans = k_2(v, -2e9, 2e9, -2e9, 2e9);
        cout << ans[1] << " " << ans[2] << " " << ans[3] << "\n";
        cout << ans[4] << " " << ans[5] << " " << ans[6] << "\n";
    }
}

Compilation message

izvanzemaljci.cpp: In function 'int main()':
izvanzemaljci.cpp:40:27: error: 'k_2' was not declared in this scope
   40 |         vector<int> ans = k_2(v, -2e9, 2e9, -2e9, 2e9);
      |                           ^~~