Submission #1088743

#TimeUsernameProblemLanguageResultExecution timeMemory
1088743quangminh412Wall (IOI14_wall)C++14
8 / 100
3087 ms18260 KiB
#include <bits/stdc++.h>
using namespace std;

/*
  John Watson
  https://codeforces.com/profile/quangminh98

  Mua Code nhu mua Florentino !!
*/

#define faster() ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long

const int maxn = 2e6 + 9;

int n, k;
int arr[maxn];

void buildWall(int _n, int _k, int op[], int left[], int right[], int height[], int finalHeight[])
{
	n = _n;
	k = _k;
	
	for (int i = 0; i < k; i++)
	{
		int limit = height[i];
		int l = left[i], r = right[i];
		if (op[i] == 1)
		{
			for (int i = l; i <= r; i++)
				if (arr[i] < limit)
					arr[i] = limit;
		} else
		{
			for (int i = l; i <= r; i++)
				if (arr[i] > limit)
					arr[i] = limit;
		}
	}
	
	for (int i = 0; i < n; i++)
		finalHeight[i] = arr[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...