Submission #113971

# Submission time Handle Problem Language Result Execution time Memory
113971 2019-05-29T11:43:10 Z E869120 Wall (IOI14_wall) C++14
8 / 100
3000 ms 26104 KB
#include "wall.h"
#include <bits/stdc++.h>
using namespace std;

int N, Q, ty[1 << 21], L[1 << 21], R[1 << 21], H[1 << 21], A[1 << 21];

void buildWall(int n, int k, int op[], int left[], int right[], int height[], int finalHeight[]){
	N = n; Q = k;
	for (int i = 1; i <= Q; i++) { ty[i] = op[i - 1]; L[i] = left[i - 1]; R[i] = right[i - 1]; H[i] = height[i - 1]; }
	
	for (int i = 1; i <= Q; i++) {
		if (ty[i] == 1) {
			for (int j = L[i]; j <= R[i]; j++) A[j] = max(A[j], H[i]);
		}
		if (ty[i] == 2) {
			for (int j = L[i]; j <= R[i]; j++) A[j] = min(A[j], H[i]);
		}
	}
	for (int i = 0; i < N; i++) finalHeight[i] = A[i];
}

# Verdict Execution time Memory Grader output
1 Correct 2 ms 384 KB Output is correct
2 Correct 4 ms 640 KB Output is correct
3 Correct 3 ms 512 KB Output is correct
4 Correct 16 ms 760 KB Output is correct
5 Correct 17 ms 768 KB Output is correct
6 Correct 16 ms 768 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 384 KB Output is correct
2 Correct 151 ms 21928 KB Output is correct
3 Correct 909 ms 11000 KB Output is correct
4 Execution timed out 3020 ms 26104 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 384 KB Output is correct
2 Correct 4 ms 640 KB Output is correct
3 Correct 3 ms 512 KB Output is correct
4 Correct 15 ms 768 KB Output is correct
5 Correct 16 ms 768 KB Output is correct
6 Correct 15 ms 768 KB Output is correct
7 Correct 2 ms 384 KB Output is correct
8 Correct 150 ms 22008 KB Output is correct
9 Correct 929 ms 10832 KB Output is correct
10 Execution timed out 3090 ms 26076 KB Time limit exceeded
11 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 384 KB Output is correct
2 Correct 4 ms 640 KB Output is correct
3 Correct 3 ms 384 KB Output is correct
4 Correct 16 ms 768 KB Output is correct
5 Correct 16 ms 768 KB Output is correct
6 Correct 16 ms 768 KB Output is correct
7 Correct 2 ms 384 KB Output is correct
8 Correct 150 ms 21924 KB Output is correct
9 Correct 888 ms 10848 KB Output is correct
10 Execution timed out 3030 ms 26104 KB Time limit exceeded
11 Halted 0 ms 0 KB -