제출 #587404

#제출 시각아이디문제언어결과실행 시간메모리
587404AlperenT로봇 (IOI13_robots)C++17
14 / 100
567 ms38708 KiB
#include <bits/stdc++.h> #include "robots.h" using namespace std; int ans = 0; int putaway(int a, int b, int t, int x[], int y[], int w[], int s[]){ sort(x, x + a); multiset<int> st; for(int i = 0; i < t; i++) st.insert(w[i]); while(!st.empty()){ ans++; bool flag = false; int cur = 0; while(!st.empty() && cur != a){ int indx = upper_bound(x + cur, x + a, *st.begin()) - x; if(indx == a) break; else{ cur = indx + 1; auto it = prev(st.lower_bound(x[indx])); st.erase(it); flag = true; } } if(flag == false) return -1; } 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...