| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1355071 | yogesh_sane | Sorting (IOI15_sorting) | C++20 | 13 ms | 484 KiB |
#include <bits/stdc++.h>
using namespace std;
int findSwapPairs(int N, int S[], int M, int X[], int Y[], int P[], int Q[]) {
vector<int>pos(N);
for(int i = 0; i < M; i++){
iota(pos.begin(), pos.end(), 0);
for(int j = i+1; j < M; j++)
swap(pos[X[j]], pos[Y[j]]);
swap(S[X[i]], S[Y[i]]);
for(int j = 0; j < N; j++){
if(S[pos[j]] != j){
int k = find(S, S+N, j)-S;
P[i] = pos[j];
Q[i] = k;
swap(S[pos[j]], S[k]);
break;
}
}
}
return M;
}| # | 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... | ||||
