# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
867499 | cheat_when_I_was_young | Arranging Shoes (IOI19_shoes) | C++17 | 75 ms | 75480 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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... |