Submission #258849

#TimeUsernameProblemLanguageResultExecution timeMemory
258849davi_bartRobots (IOI13_robots)C++14
14 / 100
262 ms15928 KiB
#include <bits/stdc++.h> #include "robots.h" using namespace std; #define ll long long mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); int putaway(int A, int B, int T, int X[], int Y[], int W[], int S[]){ vector<int> w,s; for(int i=0;i<A;i++)w.push_back(X[i]); for(int i=0;i<B;i++)s.push_back(Y[i]); sort(w.begin(),w.end()); sort(s.begin(),s.end()); vector<int> p(60000,0); //cout<<w.back()<<endl; for(int i=0;i<T;i++){ if(W[i]<w.back()){ int pos=lower_bound(w.begin(),w.end(),W[i]+1)-w.begin(); p[pos]++; }else{ return -1; } } int ans=0; int tot=0; for(int i=A-1;i>=0;i--){ tot+=p[i]; ans=max(ans,(tot+A-i-1)/(A-i)); } return ans; }
#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...