| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 114470 | arman_ferdous | Sorting (IOI15_sorting) | C++17 | 13 ms | 384 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "sorting.h"
#include <bits/stdc++.h>
using namespace std;
int tmp[20010];
int findSwapPairs(int N, int S[], int M, int X[], int Y[], int P[], int Q[]) {
for(int i = 0; i < M; i++)
swap(S[X[i]], S[Y[i]]);
int cur = 0, R = 0;
for(int i = 0; i < N; ) {
if(S[i] == i) { i++; continue; }
int p = i, q = S[i];
for(int j = M-1; j > cur; j--) {
if((X[j] == p && Y[j] == q) || (X[j] == q && Y[j] == p)) swap(p, q);
else {
if(X[j] == p) p = Y[j];
else if(Y[j] == p) p = X[j];
if(X[j] == q) q = Y[j];
else if(Y[j] == q) q = X[j];
}
}
P[R] = p, Q[R] = q;
R++; cur++;
swap(S[i], S[S[i]]);
}
while(R < M) {
P[R] = Q[R] = 0;
R++;
}
return R;
}| # | 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... | ||||
