Submission #1041972

# Submission time Handle Problem Language Result Execution time Memory
1041972 2024-08-02T11:24:26 Z ALeonidou Wall (IOI14_wall) C++17
8 / 100
3000 ms 13904 KB
#include "wall.h"
#include <bits/stdc++.h>
using namespace std;

#define ll int
#define F first
#define S second
#define sz(x) (ll)x.size()
#define endl "\n"
#define pb push_back

typedef vector <ll> vi;
typedef pair <ll,ll> ii;
typedef vector <ii> vii;

#define dbg(x) cout<<#x<<": "<<x<<endl;
#define dbg2(x,y) cout<<#x<<": "<<x<<" "<<#y<<": "<<y<<endl;
#define dbg3(x,y,z) cout<<#x<<": "<<x<<" "<<#y<<": "<<y<<" "<<#z<<": "<<z<<endl;

void printVct(vi &v){
    for (ll i =0; i<sz(v); i++){
        cout<<v[i]<<" ";
    }
    cout<<endl;
}

void buildWall(ll n, ll k, ll op[], ll left[], ll right[], ll height[], ll finalHeight[]){
	for (ll i =0; i<n; i++){
		finalHeight[i] = 0;
	}
	for (ll i =0; i<k ; i++){
		for (ll j = left[i]; j<=right[i]; j++){
			if (op[i] == 1){	//add
				finalHeight[j] = max(finalHeight[j], height[i]);
			}
			else{	//remove
				finalHeight[j] = min(finalHeight[j], height[i]);
			}
		}
	}
	return;
}

# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 1 ms 452 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 11 ms 604 KB Output is correct
5 Correct 11 ms 604 KB Output is correct
6 Correct 11 ms 644 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 67 ms 11112 KB Output is correct
3 Correct 812 ms 5700 KB Output is correct
4 Execution timed out 3052 ms 13904 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 11 ms 636 KB Output is correct
5 Correct 12 ms 604 KB Output is correct
6 Correct 11 ms 604 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 79 ms 11316 KB Output is correct
9 Correct 829 ms 6124 KB Output is correct
10 Execution timed out 3006 ms 13652 KB Time limit exceeded
11 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 11 ms 632 KB Output is correct
5 Correct 11 ms 604 KB Output is correct
6 Correct 12 ms 636 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 69 ms 11132 KB Output is correct
9 Correct 842 ms 5632 KB Output is correct
10 Execution timed out 3032 ms 13652 KB Time limit exceeded
11 Halted 0 ms 0 KB -