# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
553883 | elazarkoren | Robots (IOI13_robots) | C++17 | 122 ms | 15944 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "robots.h"
#include <bits/stdc++.h>
#define x first
#define y second
#define all(v) v.begin(), v.end()
#define chkmin(a, b) a = min(a, b)
#define chkmax(a, b) a = max(a, b)
using namespace std;
typedef long long ll;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef pair<int, int> pii;
typedef vector<pii> vii;
bool good[2][2];
int putaway(int a, int b, int t, int x[], int y[], int w[], int s[]) {
vii robots;
for (int i = 0; i < a; i++) {
robots.push_back({i, 0});
}
for (int j = 0; j < b; j++) {
robots.push_back({j, 1});
}
for (int i = 0; i < t; i++) {
int count = 0;
for (int j = 0; j < 2; j++) {
if (robots[j].y && s[i] < y[robots[j].x]) {
good[i][j] = true;
count++;
} else if (!robots[j].y && w[i] < x[robots[j].x]) {
good[i][j] = true;
count++;
}
}
if (!count) return -1;
}
if (good[0][0] && good[1][1] || good[1][0] && good[0][1]) return 1;
return 2;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |