제출 #428124

#제출 시각아이디문제언어결과실행 시간메모리
428124Rouge_Hugo벽 (IOI14_wall)C++14
0 / 100
794 ms35572 KiB
#include<bits/stdc++.h> #include "wall.h" #define ll long long #define fi first #define se second #define pb push_back using namespace std; const int N=100090; vector<int>v[N],vv[N]; multiset<int>s; void buildWall(int n, int k, int op[], int l[], int r[], int h[], int a[]){ for(int i=0;i<k;i++) { if(op[i]==2)break; v[l[i]].pb(h[i]); vv[r[i]].pb(h[i]); } s.insert(0); for(int i=0;i<n;i++) { for(auto it:v[i]) s.insert(it); int x=*s.rbegin(); a[i]=max(a[i],x); for(auto it:vv[i]) s.erase(it); } s.clear(); s.insert(1e9); for(int i=0;i<n+1;i++){ v[i].clear(); vv[i].clear(); } for(int i=0;i<k;i++) { if(op[i]==1)continue; v[l[i]].pb(h[i]); vv[r[i]].pb(h[i]); } for(int i=0;i<n;i++) { for(auto it:v[i]) s.insert(it); int x=*s.begin(); a[i]=min(a[i],x); for(auto it:vv[i]) s.erase(it); } 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...