이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
#include "wall.h"
#define ll long long
#define f first
#define s second
using namespace std;
const int maxn=2e6+5;
int N,Q;
vector<pair<int,int>> sta[maxn];
int resavaj(vector<pair<int,int>> V){
int minr=1e9,res=0;
for(int i=V.size()-1;i>=0;i--){
if(V[i].f==2)
minr=min(minr,V[i].s);
else
res=max(res,min(V[i].s,minr));
}
/*
int h=0;
for(auto x:V){
if(x.first==1)
h=max(h,x.second);
else
h=min(h,x.second);
}
// cout<<h<<endl;
if(h!=res)
cout<<"LOSE"<<endl;*/
//cout<<h<<" "<<res<<endl;
// cout<<v1<<" "<<v2<<endl;
return res;
}
void buildWall(int n, int k, int op[], int left[], int right[], int height[], int finalHeight[]){
N=n;
Q=k;
for(int i=0;i<Q;i++){
for(int j=left[i];j<=right[i];j++)
sta[j].push_back({op[i],height[i]});
}
for(int i=0;i<N;i++){
// cout<<"I je "<<i<<endl;
finalHeight[i]=resavaj(sta[i]);
}
}
# | 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... |