Submission #122061

#TimeUsernameProblemLanguageResultExecution timeMemory
122061Gustav벽 (IOI14_wall)C++14
8 / 100
3095 ms18200 KiB
#include <bits/stdc++.h>
#include "wall.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pi;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<pi> vpi;
typedef vector<vi> vvi;
const int inf = 0x3f3f3f3f;
const ll linf = 123456789012345678;
const ll mod = 998244353;
#pragma GCC optimize("Ofast")
#define all(x) x.begin(), x.end()
#define debug(x) cerr << #x << " = " << x << endl

void buildWall(int n, int k, int op[], int left[], int right[], int height[], int finalHeight[]){
    for(int i = 0; i < n; i++) finalHeight[i] = 0;
    for(int i = 0; i < k; i++){
        for(int j = left[i]; j <= right[i]; j++){
            if(op[i] == 1){
                finalHeight[j] = max(finalHeight[j], height[i]);
            }
            else{
                finalHeight[j] = min(finalHeight[j], height[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...