제출 #1276056

#제출 시각아이디문제언어결과실행 시간메모리
1276056hiepsimauhong벽 (IOI14_wall)C++20
8 / 100
3094 ms8476 KiB
#include <bits/stdc++.h>

using namespace std;

#include "wall.h"
using ll = long long;

#define fs first
#define sd second
#define ii pair<int,int>
#define iii pair<int, ii>
#define all(A) A.begin(), A.end()

const int N = 2e6 + 5;

int a[N];

void buildWall(int n, int k, int op[], int left[], int right[], int height[], int finalHeight[]) {
        for(int i(0) ; i < k;  ++i){
                if(op[i] == 1){
                        for(int j = left[i] ; j <= right[i] ; ++j){
                                a[j] = max(a[j], height[i]);
                        }
                }
                else{
                        for(int j = left[i] ; j <= right[i] ; ++j){
                                a[j] = min(a[j], height[i]);
                        }
                }
        }

        for(int i(0) ; i < n ; ++i){
                finalHeight[i] = a[i];
        }
        return;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...