답안 #1076719

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1076719 2024-08-26T15:52:30 Z LCJLY 정렬하기 (IOI15_sorting) C++14
0 / 100
1 ms 600 KB
#include "sorting.h"
#include <bits/stdc++.h>
//#include "grader.cpp"
using namespace std;

#define show(x,y) cout << y << " " << #x << endl;
#define show2(x,y,i,j) cout << y << " " << #x << "  " << j << " " << #i << endl;
#define show3(x,y,i,j,p,q) cout << y << " " << #x << "  " << j << " " << #i << "  " << q << " " << #p << endl;
#define show4(x,y) for(auto it:y) cout << it << " "; cout << #x << endl;

int findSwapPairs(int N, int S[], int M, int X[], int Y[], int P[], int Q[]) {
    int arr[N];
    int pos[N];
    for(int x=0;x<N;x++){
		arr[x]=x;
		pos[arr[x]]=x;
	}
	
	for(int x=0;x<M;x++){
		swap(arr[pos[X[x]]],arr[pos[Y[x]]]);
		swap(pos[X[x]],pos[Y[x]]);
	}
	
	for(int x=0;x<M;x++){
		P[x]=arr[x];
		Q[x]=S[x];
	}
	return M;
}


# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Incorrect 1 ms 432 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Incorrect 1 ms 432 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 344 KB Integer 20556272 violates the range [0, 1]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Incorrect 1 ms 432 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 600 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 600 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -