제출 #1105023

#제출 시각아이디문제언어결과실행 시간메모리
1105023tammaidai로봇 (IOI13_robots)C++17
0 / 100
2 ms4432 KiB
#include "robots.h" #include<bits/stdc++.h> using namespace std; struct AB { int w,s; bool operator<(const AB&o)const{ return w<o.w; } }; int putaway(int A, int B, int T, int X[], int Y[], int W[], int S[]) { int l = 1,r=1000000; vector<AB> t; for(int i = 0;i<T;i++){ t.push_back({W[i],S[i]}); } sort(t.begin(),t.end()); sort(X,X+A); sort(Y,Y+B); while(l<r){ int m = (l+r)>>1; int idx = 0; priority_queue<int> pq; for(int i = 0;i<A;i++){ for(;idx<T;idx++){ if(t[idx].w>X[i])break; pq.push(t[idx].s); } int cnt = 0; while(!pq.empty() && cnt<m){ pq.pop(); cnt++; } } for(;idx<T;idx++){ pq.push(t[idx].s); } for(int i = B-1;i>=0;i--){ int cnt = 0; if(pq.empty() || pq.top()>Y[i])break; while(!pq.empty() && cnt<m){ pq.pop(); cnt++; } } if(pq.empty()){ l=m+1; } else{ r=m; } } return l; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...