Submission #889421

#TimeUsernameProblemLanguageResultExecution timeMemory
889421htphong0909Global Warming (NOI13_gw)C++17
Compilation error
0 ms0 KiB
#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 (stderr)

/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