# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
232357 | jam_xd_ | 곤돌라 (IOI14_gondola) | C++17 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "ricehub.h"
#include <bits/stdc++.h>
int besthub(int R, int L, int X[], long long B)
{
int rhub = 1;//thub=0;
int operaciones = 0, c_hub=0;
multiset<int>dinamic_multiset;
for(int i=0;i<X.size();i++){
if(rhub <= X[i]){
for(int j=X[i];j>=rhub;j++){
operaciones++;
if(operaciones >= B){
dinamic_multiset.insert(c_hub);
operaciones=0;
c_hub=0;
break;
}
}
c_hub++;
}
if(rhub >= X[i]){
for(int j=X[i];j<=rhub;j++){
operaciones++;
if(operaciones>=B){
dinamic_multiset.insert(c_hub);
operaciones = 0;
c_hub=0;
break;
}
}
c_hub++;
}
}
multiset<int>::iterator it = dinamic_multiset.end();
for(it = dinamic_multiset.begin(); it != dinamic_multiset.end(); it++){
if(it != dinamic_multiset.end())R = (*it);
}
/////////////////////////////////////////////////////////////////////
/*for(int i=1;i<=L;i++){
}*/
return R;
}