Submission #582805

#TimeUsernameProblemLanguageResultExecution timeMemory
582805MohamedFaresNebiliRobots (IOI13_robots)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>

        using namespace std;
        using namespace __gnu_pbds;

        using ll = long long;
        using pi = pair<ll, pair<ll, ll>>;
        using ii = pair<int, int>;

        #define pb push_back
        #define pp pop_back
        #define ff first
        #define ss second

        typedef tree<int, null_type, less<int>, rb_tree_tag,
            tree_order_statistics_node_update> indexed_set;

        bool cmp(ii A, ii B) {
            return max(A.ff, A.ss) < max(B.ff, B.ss);
        }

        int putaway(int A, int B, int T, int X[],
            int Y[], int W[], int S[]) {
            vector<ii> arr;
            for(int l = 0; l < T; l++)
                arr.pb({W[l], S[l]});
            sort(arr.begin(), arr.end(), cmp);
            sort(X, X + A), sort(Y, Y + B);
            for(int l = T - 1; l >= 0; l--) {
                int U = arr[l].ff, V = arr[l].ss;
                if(A > 0 && U < X[A - 1]) continue;
                if(B > 0 && V < Y[B - 1]) continue;
                return -1;
            }
            if(A > 0 && B > 0) return 1;
            return 2;
        }

Compilation message (stderr)

/usr/bin/ld: /tmp/ccEdnbG2.o: in function `main':
grader.c:(.text.startup+0x1b1): undefined reference to `putaway'
collect2: error: ld returned 1 exit status