# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
66427 | Hoget157 | Sorting (IOI15_sorting) | C++14 | 270 ms | 12636 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>
#define pb push_back
using namespace std;
int n,*a,m,*x,*y,r;
bool C(int k){
int p[200000],ans = 0;
bool used[200000] = {};
for(int i = 0;i < n;i++) p[i] = a[i];
for(int i = 0;i < k;i++) swap(p[x[i]],p[y[i]]);
for(int i = 0;i < n;i++){
if(!used[i]){
int pos = i;
while(!used[pos]){
ans++;
used[pos] = true;
pos = p[pos];
}
ans--;
}
}
return ans <= k;
}
typedef pair<int,int> pii;
int b[200000];
int findSwapPairs(int N, int S[], int M, int X[], int Y[], int P[], int Q[]) {
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... |