Submission #427953

# Submission time Handle Problem Language Result Execution time Memory
427953 2021-06-15T06:00:10 Z haxorman Sorting (IOI15_sorting) C++14
0 / 100
1 ms 460 KB
#include "sorting.h"
#include "bits/stdc++.h"
using namespace std;

const int mxN = 2e5 + 7;

int n, m, arr[mxN], pos[mxN];

int findSwapPairs(int N, int S[], int M, int X[], int Y[], int P[], int Q[]) {
	n = N, m = M;

	for (int i = 0; i < n; ++i) {
		arr[i] = S[i];
		pos[arr[i]] = i;
	}

	for (int i = 0; i < n; ++i) {
		P[i] = i, Q[i] = pos[i];
	}

	return n;
}


Compilation message

sorting.cpp: In function 'int findSwapPairs(int, int*, int, int*, int*, int*, int*)':
sorting.cpp:9:46: warning: unused parameter 'X' [-Wunused-parameter]
    9 | int findSwapPairs(int N, int S[], int M, int X[], int Y[], int P[], int Q[]) {
      |                                          ~~~~^~~
sorting.cpp:9:55: warning: unused parameter 'Y' [-Wunused-parameter]
    9 | int findSwapPairs(int N, int S[], int M, int X[], int Y[], int P[], int Q[]) {
      |                                                   ~~~~^~~
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 460 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 460 KB Output isn't correct
2 Halted 0 ms 0 KB -