# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
775559 | Trumling | 벽 (IOI14_wall) | C++14 | 208 ms | 31640 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "wall.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
#define F first
#define S second
#define enter cout<<'\n';
#define INF 99999999999999999
#define MOD 1000000007
#define all(x) x.begin(),x.end()
void buildWall(int n, int k, int op[], int left[], int right[], int height[], int finalHeight[]){
vector<pair<int,pair<int,int>>>v;
for(int i=0;i<k;i++)
{
if(op[i]==2)
break;
v.pb({left[i],{height[i],right[i]}});
}
sort(all(v));
ll idx=0;
priority_queue<pair<int,int>>pq;
for(int i=0;i<n;i++)
{
while(idx<v.size() && v[idx].F==i)
{
pq.push({v[idx].S.F,v[idx].S.S});
idx++;
}
while(!pq.empty() && pq.top().S<i)
pq.pop();
if(!pq.empty())
finalHeight[i]=pq.top().F;
}
while(!pq.empty())
pq.pop();
v.clear();
for(int i=0;i<k;i++)
{
if(op[i]==1)
continue;
v.pb({left[i],{height[i],right[i]}});
}
sort(all(v));
idx=0;
for(int i=0;i<n;i++)
{
while(idx<v.size() && v[idx].F==i)
{
pq.push({-v[idx].S.F,v[idx].S.S});
idx++;
}
while(!pq.empty() && pq.top().S<i)
pq.pop();
if(!pq.empty())
finalHeight[i]=min(-pq.top().F,finalHeight[i]);
}
return;
}
컴파일 시 표준 에러 (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... |