# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
867499 | cheat_when_I_was_young | Arranging Shoes (IOI19_shoes) | C++17 | 75 ms | 75480 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 "shoes.h"
#include "bits/stdc++.h"
using namespace std;
void update(int pos, int val, vector<int> &bit) {
++pos;
for (; pos < (int)bit.size(); pos += pos&-pos)
bit[pos] += val;
}
void range_update(int l, int r, int val, vector<int> &bit) {
update(l, val, bit);
update(r+1, -val, bit);
}
int get(int pos, vector<int> &bit) {
++pos;
int res = 0;
for (; pos > 0; pos -= pos&-pos)
res += bit[pos];
return res;
}
long long count_swaps(vector<int> s) {
int n = (int)s.size();
long long ans = 0;
vector<int> bit(n+1, 0);
vector<vector<int>> l(n/2+1, vector<int>());
vector<queue<int>> r(n/2+1, queue<int>());
# | 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... |