답안 #426976

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
426976 2021-06-14T11:29:31 Z Dakto 벽 (IOI14_wall) C++17
0 / 100
286 ms 25648 KB
#include "wall.h"
#include <bits/stdc++.h>

using namespace std;

void buildWall(int n, int k, int op[], int left[], int right[], int height[], int finalHeight[]){
    map<int,vector<int>> beg,end;
    set<int> low,high;
    for(int i=0; i<k; i++){
        beg[left[i]].push_back(i);
        end[right[i]+1].push_back(i);
    }
    for(int i=0; i<n; i++){
        for(auto j:beg[i]){
            if(op[j]==1) low.insert(height[j]);
            else high.insert(height[j]);
        }
        for(auto j:end[i]){
            if(op[j]==1) low.erase(low.find(height[j]));
            else high.erase(high.find(height[j]));
        }
        finalHeight[i]=min(low.empty()?0:*next(low.end(),-1), high.empty()?1000000:*(high.begin()));
    }
}

# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Incorrect 4 ms 688 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 286 ms 25648 KB Output is correct
3 Runtime error 223 ms 24976 KB Execution killed with signal 6
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Incorrect 4 ms 716 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Incorrect 3 ms 716 KB Output isn't correct
3 Halted 0 ms 0 KB -