# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
745154 | jjcoder | 밀림 점프 (APIO21_jumps) | C++14 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include <cstdio>
using namespace std;
#define ll long long int
#define ull unsigned long long int
#define forn(a,b) for(int a=0; a<b; a++)
#define FOR(a,b) for(int a=1; a<=b; a++)
#define getmax(a,b) ((a)>(b)?(a):(b))
#define mp(a,b) make_pair(a,b)
#define vi vector<int>
#define vull vector<unsigned long long int>
#define vll vector<long long int>
#define vp vector<pair<int,int>>
#define vs vector<string>
#define pb push_back
#define s(a) sort(a.begin(),a.end())
#define sr(a) sort(a.rbegin(),a.rend())
int z=1e9+7;
int arr[20001],arr1[200010];
// find the number of digit in an integer : floor(log10(n))+1
/*vector<pair<int,int>>vec;
vec.push_back({2,3});
vec.push_back({3,2});
sort(vec.rbegin(),vec.rend());
cout << vec[0].first<<" "<<vec[0].second <<endl;
cout << vec[1].first<<" "<<vec[1].second <<endl;
*/
/*for (auto it = v.begin(); it != v.end(); ++it) { // for map<ll,vector<ll>>qweqwe
cout << "Key: " << it->first << ", Values: ";
for (auto val : it->second) {
cout << val << " ";
}
cout << endl;
}*/
/*for (auto& iter: s) { // for map<int,int>qweqwe
std::cout << iter.first << ": " << iter.second << std::endl;
}*/
/*int factorial(ull y)
{
if(y<=1)return 1;
else return y*factorial(y-1);
}
void setIO(string n)
{
freopen((n+".in").c_str(),"r",stdin);
freopen((n+".out").c_str(),"w",stdout);
}
*/
void init(int N, vi H)
{
return;
}
int minimum_jumps(int A, int B, int C, int D)
{
vi ans;
for(int l=A; l<=B; l++)
{
for(int x=C; x<=D; x++)
{
vp visited,queue_up;
int n=0,k=H[l];
queue_up.pb(mp(H[l],n));
while(!queue_up.empty())
{
n++;
for(int i=l; i>=0; i--)
{
if(H[i]>H[l])
{
queue_up.insert(queue_up.begin(),mp(H[i],n));
break;
}
}
for(int i=l; i<=H.size(); i++)
{
if(H[i]>H[l])
{
queue_up.insert(queue_up.begin(),mp(H[i],n));
break;
}
}
visited.pb(mp(k,n));
queue_up.pop_back();
k=queue_up[queue_up.size()-1].first;
}
for(int i=0; i<=visited.size(); i++){
if(visited[i].first==x)ans.pb(visited[i].second);
}
}
}
s(ans);
return ans[0];//ans
}
int xmain()
{
//setIO("input");
ios::sync_with_stdio(0);
return 0;
}