# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
397781 | qwerty234 | Boxes with souvenirs (IOI15_boxes) | C++14 | 1 ms | 336 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 "boxes.h"
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define fi first
#define se second
using namespace std;
vector <int> val_cw, val_ccw, cf_cw, cf_ccw;
vector <pair<int, int>> op_cw, op_ccw, cw, ccw;;
int s_cw, s_ccw, add, shift_cw, shift_ccw, n_cw, n_ccw, n, k;
ll ans_cw, ans_ccw, ans, add_cw, add_ccw, l;
void process_cw(int x, bool flag) {
if (s_cw == 0) {
op_cw.clear();
return;
}
if (flag) {
int i = n_cw - 1; op_cw.clear();
while (x > 0 && i >= 0) {
while (x > 0 && cw[i].se > 0) {
cw[i].se--; x--; op_cw.pb({1, i});
s_cw--; op_cw.pb({2, 0});
shift_cw = (shift_cw + 1) % k; op_cw.pb({3, 0});
ans_cw -= (ll)val_cw[shift_cw]; op_cw.pb({4, val_cw[shift_cw]});
}
if (cw[i].se == 0) {
n_cw--; op_cw.pb({5, 0});
val_cw[shift_cw] -= cf_cw[i]; op_cw.pb({-shift_cw, cf_cw[i]});
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |