Submission #889421

# Submission time Handle Problem Language Result Execution time Memory
889421 2023-12-19T16:11:22 Z htphong0909 Global Warming (NOI13_gw) C++17
Compilation error
0 ms 0 KB
#include<bits/stdc++.h>
using namespace std;

int gw(int N, int *H)
{
    vector <int> ed;
    for (int i = 1; i < N; i++) ed.emplace_back(min(H[i], H[i - 1]));
    sort(H, H + N);
    sort(ed.begin(), ed.end());
    int p = -1;
    int ans = 0;
    for (int i = 0; i < N - 1; i++)
    {
        while (p + 1 < N && H[p + 1] <= ed[i]) p++;
        ans = max(ans, 1 + i - p);
    }
    return ans;
}

Compilation message

/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/crt1.o: in function `_start':
(.text+0x24): undefined reference to `main'
collect2: error: ld returned 1 exit status