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 "swaps.h"
#include <bits/stdc++.h>
using namespace std;
void solve(int N, int V) {
srand(time(NULL));
vector<int> x(N);
for(int i = 0; i < N; i++) x[i] = i + 1;
vector<int> shuff(N);
for(int i = 0; i < N; i++) {
shuff[i] = i+1;
}
while(V--) {
for(int i = 0; i < N; i++) {
int g = rand() % N;
swap(shuff[i], shuff[g]);
}
for(int i = 0; i < N-1; i += 2) {
schedule(min(shuff[i], shuff[i+1]), max(shuff[i], shuff[i+1]));
}
visit();
}
answer(x);
}
# | 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... |