제출 #783954

#제출 시각아이디문제언어결과실행 시간메모리
783954canadavid1벽 (IOI14_wall)C++14
8 / 100
3051 ms9632 KiB
#include "wall.h"
#include <bits/stdc++.h>
using namespace std;

#define clamp(x,l,r) x=min(r,max(x,l))
#define all(x) begin(x),end(x)

void buildWall(int n, int k, int op[], int left[], int right[], int height[], int finalHeight[]){
    vector<int> wall(n,0);
    for(int i = 0; i < k; i++)
    {
        auto t = op[i];
        int l = left[i];
        int r = right[i];
        int val = height[i];
        if(t==1) for(int j = l; j <= r; j++) wall[j] = max(wall[j],val);
        else for(int j = l; j <= r; j++) wall[j] = min(wall[j],val);
    }
    for(auto i : wall) *finalHeight++ = i;
}

#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...