Submission #142721

#TimeUsernameProblemLanguageResultExecution timeMemory
142721HellAngelGap (APIO16_gap)C++14
Compilation error
0 ms0 KiB
#include "gap.h"
#include <bits/stdc++.h>
#define int long long
using namespace std;


long long findGap(int T, int N)
{
    int ans = 0;
    if(T == 1)
    {
        int mx, my;
        vector<int> vt = {};
        int l = 0;
        int r = 1e18;
        while(true)
        {
            MinMax(l, r, &mx, &my);
            if(mx == my)
            {
                vt.push_back(mx);
                break;
            }
            if(mx == -1)
            {
                break;
            }
            vt.push_back(mx);
            vt.push_back(my);
            l = mx + 1;
            r = my - 1;
        }
        sort(vt.begin(), vt.end());
        for(int i = 1; i < vt.size(); i++)
        {
            ans = max(ans, vt[i] - vt[i - 1]);
        }
    }
	return ans;
}

Compilation message (stderr)

gap.cpp: In function 'long long int findGap(long long int, long long int)':
gap.cpp:34:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for(int i = 1; i < vt.size(); i++)
                        ~~^~~~~~~~~~~
/tmp/ccBtgxYN.o: In function `main':
grader.cpp:(.text.startup+0x18e): undefined reference to `findGap(int, int)'
collect2: error: ld returned 1 exit status