Submission #688032

#TimeUsernameProblemLanguageResultExecution timeMemory
688032zeroesandones벽 (IOI14_wall)C++17
8 / 100
3035 ms18116 KiB
#include <bits/stdc++.h> #include "wall.h" using namespace std; typedef long long ll; typedef long double ld; typedef vector<ll> vi; typedef pair<ll, ll> pi; #define FOR(i, j, k) for(ll i = (ll) (j); (i) < (ll) (k); ++(i)) #define FORD(i, j, k) for(ll i = (ll) (j); (i) >= (ll) (k); --(i)) #define pb emplace_back #define all(x) (x).begin(), (x).end() #define nl "\n" #define sp " " #define fr first #define sc second void buildWall(int n, int k, int op[], int left[], int right[], int height[], int finalHeight[]){ // adding phase: // set all values in this range to max(val, currentval) // removing phase : // set all values in this range to min(val, currentval) FOR(i, 0, k) { if(op[i] == 1) { FOR(j, left[i], right[i] + 1) { finalHeight[j] = max(finalHeight[j], height[i]); } } else { FOR(j, left[i], right[i] + 1) { finalHeight[j] = min(finalHeight[j], height[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...