# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
205404 | oko | Wall (IOI14_wall) | C++14 | 1132 ms | 38612 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include "wall.h"
#include<bits/stdc++.h>
using namespace std;
vector<pair<int,int> >mx[100005],mn[100005];
void buildWall(int n, int k, int op[], int left[], int right[], int height[], int finalHeight[])
{
for(int i=0;i<k;i++)
{
int l=left[i],r=right[i],h=height[i];
if(op[i]==1)
{
mx[l].push_back({0,h});
mx[r+1].push_back({1,h});
}
else
{
mn[l].push_back({0,h});
mn[r+1].push_back({1,h});
}
}
multiset<int>ms;
for(int i=0;i<n;i++)
{
for(int j=0;j<mx[i].size();j++)
{
pair<int,int>x=mx[i][j];
if(x.first==0)ms.insert(x.second);
else ms.erase(ms.lower_bound(x.second));
}
if(ms.size()==0)continue;
finalHeight[i]=*--ms.end();
}
ms.clear();
for(int i=0;i<n;i++)
{
for(int j=0;j<mn[i].size();j++)
{
pair<int,int>x=mn[i][j];
if(x.first==0)ms.insert(x.second);
else ms.erase(ms.lower_bound(x.second));
}
if(ms.size()==0)continue;
int z=*ms.begin();
finalHeight[i]=min(finalHeight[i],z);
}
}
컴파일 시 표준 에러 (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... |