| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1335508 | kawhiet | 정렬하기 (IOI15_sorting) | C++20 | 1 ms | 424 KiB |
#include <bits/stdc++.h>
#include "sorting.h"
using namespace std;
int n, m;
vector<int> s, x, y;
int findSwapPairs(int N, int S[], int M, int X[], int Y[], int p[], int q[]) {
n = N;
m = M;
s.assign(S, S + N);
x.assign(X, X + N);
y.assign(Y, Y + N);
vector<int> pos(n);
for (int i = 0; i < n; i++) {
pos[s[i]] = i;
}
int sz = 0;
for (int i = 0; i < n; i++) {
if (s[i] != i) {
int j = pos[i];
p[sz] = i;
q[sz] = j;
sz++;
swap(pos[i], pos[j]);
swap(s[i], s[j]);
}
}
return sz;
}| # | 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... | ||||
