# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1048000 | Maite_Morale | 밀림 점프 (APIO21_jumps) | C++17 | 164 ms | 31832 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define vll vector<ll>
#define MAX 2005
#define oo 1e18
#define pll pair<ll,ll>
#define F first
#define S second
const ll bts=20;
pll p[MAX];
vll v[MAX];
ll N,pass[MAX][MAX];
void bfs(ll x){
queue<ll> q;
q.push(x);pass[x][x]=0;
while(!q.empty()){
ll u=q.front();q.pop();
for(auto w : v[u]){
if(pass[x][w]!=-1)continue;
pass[x][w]=pass[x][u]+1;
q.push(w);
}
}
}
void init(int n, std::vector<int> h) {
h.push_back(oo);
stack<ll> s;s.push(n);
for(int i=0;i<n;i++){
while(h[i]>h[s.top()]){
p[s.top()].F=i;
if(s.top()!=n)v[s.top()].push_back(i);
s.pop();
}
p[i].S=s.top();
if(s.top()!=n) v[i].push_back(s.top());
s.push(i);
}
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
pass[i][j]=-1;
}
bfs(i);
}
}
int minimum_jumps(int A, int B, int C, int D) {
ll r=oo;
for(int i=A;i<=B;i++){
for(int j=C;j<=D;j++){
if(pass[i][j]!=-1){
r=min(r,pass[i][j]);
}
}
}
if(r==oo)return -1;
return r;
}
컴파일 시 표준 에러 (stderr) 메시지
# | 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... |