| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1324629 | thondon | Global Warming (NOI13_gw) | C++17 | 1 ms | 332 KiB |
#include <bits/stdc++.h>
using namespace std;
bitset<1000002> stat = 0;
int gw(int N, int *H)
{
int result = 0, x, answer = 0;
vector<pair<int, int>> v;
for (int i = 1; i <= N; ++i)
{
v.push_back({H[i], i});
}
sort(v.begin(), v.end());
x = v.back().first;
while (v.size() > 0)
{
while (v.back().first == x)
{
stat[v.back().second] = 1;
if (stat[v.back().second - 1] == 1 && stat[v.back().second + 1] == 1)
result--;
if (stat[v.back().second - 1] == 0 && stat[v.back().second + 1] == 0)
result++;
v.pop_back();
}
answer = max(answer, result);
x = v.back().first;
}
return answer;
}
signed main(void)
{
return 0;
}| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
