Submission #253557

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
2535572020-07-28 09:34:13spdskatrRobots (IOI13_robots)C++14
100 / 100
1891 ms26860 KiB
#include "robots.h"
#include <cstdio>
#include <vector>
#include <algorithm>
#include <utility>
#include <cstring>
#include <queue>
#define fi first
#define se second
using namespace std;
typedef pair<int, int> pii;
int A, B, T, x[50005], y[50005], w[1000005], s[1000005], maxsz, maxwt;
pii byweight[1000005];
priority_queue<int> pq;
int check(int time) {
while (!pq.empty()) pq.pop();
// Let weak toys go first
int ptr = 0;
for (int i = 0; i < A; i++) {
while (ptr < T && byweight[ptr].fi < x[i]) {
pq.push(s[byweight[ptr].se]);
ptr++;
}
for (int j = 0; !pq.empty() && j < time; j++) {
pq.pop();
}
}
while (ptr < T) {
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

robots.cpp: In function 'int putaway(int, int, int, int*, int*, int*, int*)':
robots.cpp:52:6: warning: unused variable 'cooked' [-Wunused-variable]
  int cooked = 0;
      ^~~~~~
#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...