Submission #1055472

#TimeUsernameProblemLanguageResultExecution timeMemory
1055472KasymKRainforest Jumps (APIO21_jumps)C++17
Compilation error
0 ms0 KiB
#include "bits/stdc++.h" #include "jumps.h" using namespace std; #define ff first #define ss second #define all(v) v.begin(), v.end() #define ll long long #define pb push_back #define pii pair<int, int> #define wr puts("----------------") template<class T>bool umin(T& a,T b){if(a>b){a=b;return 1;}return 0;} template<class T>bool umax(T& a,T b){if(a<b){a=b;return 1;}return 0;} const int N = 2e5+5; vector<int> adj[N]; int vis[N]; int n_; void init(int n, vector<int> v){ n_ = n; // for(int i = 0; i < n; ++i){ // for(int j = i+1; j < n; ++j) // if(v[j] > v[i]){ // adj[i].pb(j); // break; // } // for(int j = i-1; j >= 0; --j) // if(v[j] > v[i]){ // adj[i].pb(j); // break; // } // } stack<int> s; for(int i = 0; i < n; ++i){ while(!s.empty() and v[s.top()] <= v[i]) s.pop(); if (!s.empty()) adj[i].pb(s.top()); s.push(i); } while (!s.empty()) s.pop(); for(int i = n-1; i >= 0; --i){ while(!s.empty() and v[s.top()] <= v[i]) s.pop(); if (!s.empty()) adj[i].pb(s.top()); s.push(i); } }

Compilation message (stderr)

/usr/bin/ld: /tmp/ccckNLrs.o: in function `main':
stub.cpp:(.text.startup+0x1d1): undefined reference to `minimum_jumps(int, int, int, int)'
collect2: error: ld returned 1 exit status