Submission #1276054

#TimeUsernameProblemLanguageResultExecution timeMemory
1276054hiepsimauhongWall (IOI14_wall)C++20
8 / 100
3094 ms8552 KiB
#include <bits/stdc++.h>

using namespace std;

#include "wall.h"

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...