Submission #287481

# Submission time Handle Problem Language Result Execution time Memory
287481 2020-08-31T17:32:34 Z AaronNaidu Sorting (IOI15_sorting) C++14
0 / 100
2 ms 384 KB
#include <bits/stdc++.h>
using namespace std;

int findSwapPairs(int N,int S[],int M, int X[],int Y[], int P[],int Q[]) {
    for (int i = 0; i < N; i++)
    {
        for (int j = 0; j < N; j++)
        {
            if (S[j] == i)
            {
                P[i] = i;
                Q[i] = j;
                swap(S[j], S[i]);
                break;
            }          
        }
    }
    return N;
}

Compilation message

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