Submission #1146418

#TimeUsernameProblemLanguageResultExecution timeMemory
1146418brianhdzmdoWall (IOI14_wall)C++20
0 / 100
0 ms328 KiB
#include "wall.h" #include <algorithm> #include <cmath> #include <iostream> #include <math.h> #include <numeric> #include <set> #include <map> #include <string> #include <utility> #include <vector> #include <climits> #define all(a) (a).begin(), (a).end() #define allr(a) (a).rbegin(), (a).rend() #define ll int #define fr(i, a, b) for (ll i = a; i < b; i++) #define fr1(i, a, b) for (ll i = a - 1; i >= b; i--) #define fi first #define se second #define mp(j, k) make_pair(j, k) #define pb(x) push_back(x) #define pbp(x, y) push_back({x, y}) #define in(x) insert(x) #define vec vector<ll> #define vecv vector<vector<ll> > #define veb vector<bool> #define vecp vector<pair<ll,ll>> #define yes cout << "YES\n"; #define no cout << "NO\n"; #define ac 1e-7 #define fauto(a) \ for (auto i : a) \ cout << i << " "; #define fautop(a) \ for (auto i : a) \ cout << i.fi << " " << i.se << endl; using namespace std; void buildWall(ll n, ll k, ll op[], ll left[], ll right[], ll height[], ll finalHeight[]) { fr(i, 0, k) { ll l = left[i]; ll r = right[i]; ll h = height[i]; if(op[i] == 1) { fr(i, l, r + 1) { if(finalHeight[i] < h) { ll ax = h - finalHeight[i]; finalHeight[i] += ax; } } } else { fr(i, l, r + 1) { if(finalHeight[i] > h) { ll ax = finalHeight[i] - h; finalHeight[i] -= ax; } } } } fr(i, 0, n) cout << 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...