Submission #419606

# Submission time Handle Problem Language Result Execution time Memory
419606 2021-06-07T10:08:59 Z AugustinasJucas Sorting (IOI15_sorting) C++14
0 / 100
11 ms 432 KB
#include "sorting.h"

#include <bits/stdc++.h>

using namespace std;



int findSwapPairs(int N, int S[], int M, int X[], int Y[], int P[], int Q[]) {

    P[0] = 0;

	Q[0] = 0;

    for(int i = 0; i < N; i++){



        // pastatysiu i i jo vieta

        int kur = 0;

        for(int j = 0; j < N; j++) if(S[j] == i) kur = j;

        swap(S[i], S[kur]);

        P[i] = i;

        Q[i] = kur;

    }

	return N;

}


Compilation message

sorting.cpp: In function 'int findSwapPairs(int, int*, int, int*, int*, int*, int*)':
sorting.cpp:9:39: warning: unused parameter 'M' [-Wunused-parameter]
    9 | int findSwapPairs(int N, int S[], int M, int X[], int Y[], int P[], int Q[]) {
      |                                   ~~~~^
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 11 ms 432 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 11 ms 432 KB Output isn't correct
2 Halted 0 ms 0 KB -