# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1016593 | MohamedFaresNebili | The Collection Game (BOI21_swaps) | C++14 | 1 ms | 344 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 <bits/stdc++.h>
#include "swaps.h"
using namespace std;
vector<int> dcS(vector<int> A) {
if(A.size() == 1) return A;
vector<int> X, Y; int N = A.size();
for(int l = 0; l < N / 2; l++)
X.push_back(A[l]);
for(int l = N / 2; l < N; l++)
Y.push_back(A[l]);
X = dcS(X), Y = dcS(Y);
int i = 0, j = 0;
while(i != X.size() || j != Y.size()) {
if(i == X.size()) A.push_back(Y[j++]);
else if(j == Y.size()) A.push_back(X[i++]);
else {
schedule(X[i], Y[j]);
vector<int> K = visit();
if(K[0] == 0) A.push_back(Y[j++]);
else A.push_back(X[i++]);
}
}
return A;
}
void solve(int N, int V) {
vector<int> res(N);
for(int l = 0; l < N; l++)
res[l] = l + 1;
res = dcS(res);
answer(res);
}
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... |
# | 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... |