제출 #1281249

#제출 시각아이디문제언어결과실행 시간메모리
1281249repmann벽 (IOI14_wall)C++20
0 / 100
2 ms572 KiB
#include <bits/stdc++.h> using namespace std; int N, Q; vector <pair <int, int>> V[100000]; void buildWall(int n, int q, int t[], int l[], int r[], int x[], int O[]) { N = n; Q = q; for(int i = 0; i < N; i++) O[i] = 0; for(int i = 0; i < Q; i++) if(t[i] == 1) V[l[i]].push_back({x[i], r[i]}); priority_queue <pair <int, int>> H; H.push({0, INT_MAX}); for(int i = 0; i < N; i++) { for(pair <int, int> p : V[i]) H.push(p); while(H.top().second < i) H.pop(); O[i] = H.top().first; } for(int i = 0; i < N; i++) V[i] = vector <pair <int, int>>(); for(int i = 0; i < Q; i++) if(t[i] == 2) V[l[i]].push_back({x[i], r[i]}); while(H.size()) H.pop(); H.push({0, INT_MAX}); for(int i = 0; i < N; i++) { for(pair <int, int> p : V[i]) H.push({-p.first, p.second}); while(H.top().second < i) H.pop(); O[i] = min(-H.top().first, O[i]); } return; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...