# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
524550 | Lobo | 정렬하기 (IOI15_sorting) | C++17 | 1 ms | 460 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "sorting.h"
#include<bits/stdc++.h>
using namespace std;
const long long inf = (long long) 1e18 + 10;
const int inf1 = (int) 1e9 + 10;
#define int long long
#define dbl long double
#define endl '\n'
#define sc second
#define fr first
#define mp make_pair
#define pb push_back
#define all(x) x.begin(), x.end()
#define maxn 55000
int n, m, a[maxn], pos[maxn], s1[maxn], s2[maxn];
int32_t findSwapPairs(int32_t N, int32_t S[], int32_t M, int32_t X[], int32_t Y[], int32_t P[], int32_t Q[]) {
n = N;
m = M;
for(int i = 0; i < n; i++) {
a[i] = S[i];
pos[a[i]] = i;
}
for(int i = 0; i < m; i++) {
s1[i] = X[i];
s2[i] = Y[i];
}
int32_t R = 0;
for(int i = 0; i < n; i++) {
if(pos[i] != i) {
//swap a[i] and a[pos[i]]
P[R] = i;
Q[R] = pos[i];
//pos[i] = i
//pos[a[i]] = pos[i]
swap(pos[i],pos[a[i]]);
swap(a[P[R]],a[Q[R]]);
R++;
}
}
return R;
}
컴파일 시 표준 에러 (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... |