| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1030062 | jnjwnwnw | 지구 온난화 (NOI13_gw) | C++17 | 364 ms | 26520 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
using namespace std;
#define ll long long
#define fff(i, a, b) for(ll i = a; i < b; i++)
#define MAXN 1000006
bool sim[MAXN];
int main(){
ll n; cin >> n;
vector<pair<ll, ll>> v;
fff(i, 0, n){
ll a; cin >> a;
v.emplace_back(a, i+1);
}
sort(v.rbegin(), v.rend());
ll best = 0;
ll cur = 0;
ll prev = -1;
fff(i, 0, n){
auto [h, j] = v[i];
if (prev != h && cur > best) best = cur;
sim[j] = 1;
cur++;
if (sim[j+1]) cur--;
if (sim[j-1]) cur--;
prev = h;
}
cout << best << endl;
}| # | 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... | ||||
