Submission #1043457

# Submission time Handle Problem Language Result Execution time Memory
1043457 2024-08-04T09:45:16 Z mindiyak Wall (IOI14_wall) C++14
8 / 100
3000 ms 18196 KB
#pragma GCC optimize("O3")
#pragma GCC target("sse4")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<ld, ld> pd;
typedef vector<int> vi;
typedef vector<bool> vb;
typedef vector<vector<int>> vvi;
typedef vector<ld> vd;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
#define FOR(i, a, b) for (ll i = a; i < (b); i++)
#define F0R(i, a) for (ll i = 0; i < (a); i++)
#define FORd(i, a, b) for (ll i = (b)-1; i >= a; i--)
#define F0Rd(i, a) for (ll i = (a)-1; i >= 0; i--)
#define trav(a, x) for (auto &a : x)
#define uid(a, b) uniform_int_distribution<int>(a, b)(rng)
#define len(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define fst first
#define nl endl
#define sec second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define ins insert
const int MOD = 1000000007;
const int MX = INT_MAX;
const int MN = INT_MIN;

#include "wall.h"


void buildWall(int n, int k, int op[], int left[], int right[], int height[], int finalHeight[]){
  FOR(i,0,n)finalHeight[i] = 0;

  FOR(i,0,k){
    if(op[i] == 1){
      FOR(j,left[i],right[i]+1){
        finalHeight[j] = max(finalHeight[j],height[i]);
      }
    }else{
      FOR(j,left[i],right[i]+1){
        finalHeight[j] = min(finalHeight[j],height[i]);
      }
    }
  }
}

# Verdict Execution time Memory Grader output
1 Correct 1 ms 428 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 2 ms 344 KB Output is correct
4 Correct 13 ms 636 KB Output is correct
5 Correct 25 ms 600 KB Output is correct
6 Correct 18 ms 600 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 70 ms 11244 KB Output is correct
3 Correct 460 ms 5792 KB Output is correct
4 Execution timed out 3045 ms 18136 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 1 ms 572 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 13 ms 640 KB Output is correct
5 Correct 17 ms 636 KB Output is correct
6 Correct 17 ms 600 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 68 ms 13972 KB Output is correct
9 Correct 490 ms 7524 KB Output is correct
10 Execution timed out 3022 ms 18196 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 500 KB Output is correct
4 Correct 18 ms 604 KB Output is correct
5 Correct 17 ms 600 KB Output is correct
6 Correct 17 ms 604 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 69 ms 13860 KB Output is correct
9 Correct 491 ms 7532 KB Output is correct
10 Execution timed out 3059 ms 18004 KB Time limit exceeded
11 Halted 0 ms 0 KB -