제출 #258853

#제출 시각아이디문제언어결과실행 시간메모리
258853davi_bart로봇 (IOI13_robots)C++14
28 / 100
254 ms5620 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()); if(B!=0){ if(B==1){ if((S[0]<s[0] && W[1]<w[0])|| (S[1]<s[0] && W[0]<w[0]))return 1; if((S[0]<s[0] && S[1]<s[0])|| (W[1]<w[0] && W[0]<w[0]))return 2; return -1; } if((S[0]<s[0] && S[1]<s[1])|| (S[0]<s[1] && S[1]<s[0]))return 1; if((S[0]<s[1] && S[1]<s[1]))return 2; return -1; } vector<int> p(60000,0); 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...