# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
465568 | Sench2006 | Exam (eJOI20_exam) | C++14 | 183 ms | 98204 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 <bits/stdc++.h>
#include <unordered_map>
using namespace std;
#define ll long long
#define ar array
#define fastio ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
// --------------- SOLUTION --------------- //
const int N = 1e5+5;
int n;
int a[N], b[N];
int t[4 * N];
int next_max[N], prev_max[N];
int dp[5001][5001];
map <int, int> mp;
void pre() {
stack<int> s;
for (int i = 1; i <= n; ++i) {
while (!s.empty() && a[s.top()] <= a[i])
s.pop();
if (s.empty())
next_max[i] = 0;
else
next_max[i] = s.top();
s.push(i);
}
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |