# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1087020 | the_coding_pooh | 정렬하기 (IOI15_sorting) | C++14 | 1 ms | 604 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "sorting.h"
#include <bits/stdc++.h>
#define uwu return 0;
using namespace std;
const int SIZE = 2e5 + 5;
int s[SIZE], tar[SIZE], x[SIZE], y[SIZE], p[SIZE], q[SIZE], pos_of_val[SIZE];
void build(int M){
for(int i = M - 1; i >= 0; i--){
swap(tar[x[i]], tar[y[i]]);
}
return;
}
void get_sequence(int N, int M){
for(int i = 0; i < M; i++){
swap(s[x[i]], s[y[i]]);
for(int j = 0; j < N; j++){
pos_of_val[s[j]] = j;
}
swap(tar[x[i]], tar[y[i]]);
for(int j = 0; j < N; j++){
if(s[j] != tar[j]){
swap(s[j], s[pos_of_val[tar[j]]]);
p[i] = j;
q[i] = pos_of_val[tar[j]];
break;
}
}
}
return;
}
int findSwapPairs(int N, int S[], int M, int X[], int Y[], int P[], int Q[]) {
int cnt = 0;
for(int i = 0; i < N; i++){
if(S[i] != i){
for(int j = i + 1; j < N; j++){
if(S[j] == i){
P[cnt] = i;
Q[cnt] = j;
cnt++;
swap(S[i], S[j]);
break;
}
}
}
}
return cnt;
}
컴파일 시 표준 에러 (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... |