제출 #56049

#제출 시각아이디문제언어결과실행 시간메모리
56049aquablitz11로봇 (IOI13_robots)C++14
14 / 100
205 ms9084 KiB
#include <bits/stdc++.h> #include "robots.h" using namespace std; #define forn(i, n) for (int i = 0; i < (n); ++i) #define F first #define S second typedef pair<int, int> pii; const int N = 50010; const int INF = 2e9+1; bool used[N]; int putaway(int A, int B, int T, int X[], int Y[], int W[], int S[]) { int tim = 0, done = 0; bool ok = true; while (ok) { ++tim; ok = false; forn(i, A) { pii mx(-1, -1); forn(j, T) if (!used[j] && W[j] < X[i]) mx = max(mx, pii(S[j], j)); if (mx != pii(-1, -1)) { used[mx.S] = true; ok = true; ++done; continue; } } forn(i, B) { pii mx(-1, -1); forn(j, T) if (!used[j] && S[j] < Y[i]) mx = max(mx, pii(W[j], j)); if (mx != pii(-1, -1)) { used[mx.S] = true; ok = true; ++done; continue; } } if (done == T) return tim; } return -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...