Submission #135168

# Submission time Handle Problem Language Result Execution time Memory
135168 2019-07-23T17:48:16 Z arthurconmy Wall (IOI14_wall) C++14
0 / 100
175 ms 8096 KB
#include <bits/stdc++.h>
#ifndef ARTHUR_LOCAL
	#include "wall.h"
#endif
using namespace std;

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++)
	{
		if(op[i]==1) // adding
		{
			for(int j=left[i]; j<=right[i]; j++)
			{
				finalHeight[j] = max(finalHeight[j],height[j]);
			}
		}

		else
		{
			for(int j=left[i]; j<=right[i]; j++)
			{
				finalHeight[j] = min(finalHeight[j],height[j]);
			}
		}
	}
}
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Incorrect 4 ms 376 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 256 KB Output is correct
2 Incorrect 175 ms 8096 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 256 KB Output is correct
2 Incorrect 4 ms 380 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 256 KB Output is correct
2 Incorrect 4 ms 376 KB Output isn't correct
3 Halted 0 ms 0 KB -