# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1177531 | tkm_algorithms | Rainforest Jumps (APIO21_jumps) | C++20 | 11 ms | 1964 KiB |
/**
* In the name of Allah
* We are nothing and you're everything
**/
#include <bits/stdc++.h>
#include "jumps.h"
using namespace std;
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
typedef long long ll;
//#define int ll
const char nl = '\n';
const int N = 3e5;
const int inf = 1e9;
int dp[201][201];
void init(int n, vector<int> h) {
for (int i = 0; i < n; ++i)
for (int j = 0; j < n; ++j) {
if (i == j)continue;
dp[i][j] = inf;
}
stack<int> st;
vector<int> a(n, -1), b(n, -1);
for (int i = n-1; i >= 0; --i) {
while (!st.empty() && h[st.top()] <= h[i])st.pop();
if (!st.empty())a[i] = st.top();
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |