# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
349353 | David_M | Wall (IOI14_wall) | C++14 | 2 ms | 2668 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "wall.h"
#include <bits/stdc++.h>
#define pb push_back
using namespace std;
const int INF=1e9+2021;
struct uwu{int type, height, time; uwu (int x, int y, int z){time=z,type=x,height=y;} };
vector<uwu> v[100000];
int T[2][100000], M[2], K;
void build (int x=1, int l=0, int r=K){
if(l==r){ T[1][x]=(!!l)*INF; return; }
T[1][x]=min(T[1][x<<1], T[1][x<<1|1]);
}
void upd(uwu a, int x=1, int l=0, int r=K){
if(l==r){ T[a.type][x]=a.height; return; }
int mid=l+r>>1;
if(a.time<mid) upd(a, x<<1, l, mid);
else upd(a, x<<1|1, mid+1, r);
T[0][x]=max(T[0][x<<1], T[0][x<<1|1]);
T[1][x]=min(T[1][x<<1], T[1][x<<1|1]);
}
int get(int x=1, int l=0, int r=0){
if(l==r) return 0;
int m[2];
m[0]=m[1]=0;
get(1, l+r+2>>1, r);
}
void buildWall(int n, int k, int op[], int left[], int right[],int height[], int finalHeight[]){
build(); K=k;
for(int i=0; i<k; i++){
op[i]--;
v[left[i]].pb({i+1, op[i], height[i]});
v[right[i]+1].pb({i+1, op[i], op[i]==1?0:INF});
}
for (int i=0; i<n; i++){
for (int j=0; j<v[i].size(); j++) upd(v[i][j]);
M[0]=0; M[1]=INF; finalHeight[i]=get();
}
}
컴파일 시 표준 에러 (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... |