Submission #800839

# Submission time Handle Problem Language Result Execution time Memory
800839 2023-08-02T00:00:23 Z Liudas Wall (IOI14_wall) C++17
24 / 100
474 ms 30328 KB
#include <bits/stdc++.h>
#include "wall.h"
using namespace std;
void buildWall(int N, int K, int op[], int l[], int r[], int h[], int fh[]){
    vector<vector<int>> arr(N + 5);
    for(int i = 0; i < K; i ++){
        if(op[i] == 2)continue;
        arr[l[i]].push_back(h[i] + 1);
        arr[r[i]+1].push_back(-h[i] - 1);
    }
    multiset<int> mov;
    mov.insert(0);
    for(int i = 0; i < N; i ++){
        for(int j : arr[i]){
            if(j > 0)
            mov.insert(j-1);
            else
            mov.erase(mov.find(-j - 1));
        }
        fh[i] = *mov.rbegin();
        arr[i].clear();
    }
    mov.clear();
    for(int i = 0; i < K; i ++){
        if(op[i] == 1)continue;
        arr[l[i]].push_back(h[i] + 1);
        arr[r[i]+1].push_back(-h[i] - 1);
    }
    mov.insert(1e9);
    for(int i = 0; i < N; i ++){
        for(int j : arr[i]){
            if(j > 0)
            mov.insert(j-1);
            else
            mov.erase(mov.find(-j - 1));
        }
        fh[i] = min(fh[i], *mov.begin());
        arr[i].clear();
    }
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Incorrect 2 ms 596 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 312 ms 30328 KB Output is correct
3 Correct 162 ms 11792 KB Output is correct
4 Correct 474 ms 27488 KB Output is correct
5 Correct 200 ms 19944 KB Output is correct
6 Correct 182 ms 17616 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Incorrect 2 ms 560 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 296 KB Output is correct
2 Incorrect 2 ms 596 KB Output isn't correct
3 Halted 0 ms 0 KB -