제출 #886742

#제출 시각아이디문제언어결과실행 시간메모리
886742byakko로봇 (IOI13_robots)C++17
0 / 100
1 ms4540 KiB
#include "robots.h" #include <bits/stdc++.h> using namespace std; int putaway(int A, int B, int T, int X[], int Y[], int W[], int S[]) { set<int> St; for(int i = 0; i < T; i++) St.insert(W[i]); sort(X, X + A); int cont = 0; bool ok = true; while(!St.empty()) { bool deletes = false; for(int i = 0; i < A; i++) { if(St.empty()) break; auto it = St.upper_bound(X[i]); if(it == St.begin()) continue; deletes = true; it--; St.erase(it); } if(!deletes) { ok = false; break; } cont++; } return ok ? cont : -1; }
#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...