Submission #921724

#TimeUsernameProblemLanguageResultExecution timeMemory
921724coding_snorlaxSorting (IOI15_sorting)C++14
0 / 100
2 ms348 KiB
#include "sorting.h" #include<bits/stdc++.h> using namespace std; int S[1000]={4,3,2,1,0},X[1000]={0,0,0,0,0},Y[1000]={0,0,0,0,0},P[1000],Q[1000]; 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]=j; Q[i]=i; S[j]=S[i]; S[i]=i; break; } } } return N; }

Compilation message (stderr)

sorting.cpp: In function 'int findSwapPairs(int, int*, int, int*, int*, int*, int*)':
sorting.cpp:5:73: warning: declaration of 'Q' shadows a global declaration [-Wshadow]
    5 | int findSwapPairs(int N, int S[], int M, int X[], int Y[], int P[], int Q[]) {
      |                                                                     ~~~~^~~
sorting.cpp:4:73: note: shadowed declaration is here
    4 | int S[1000]={4,3,2,1,0},X[1000]={0,0,0,0,0},Y[1000]={0,0,0,0,0},P[1000],Q[1000];
      |                                                                         ^
sorting.cpp:5:64: warning: declaration of 'P' shadows a global declaration [-Wshadow]
    5 | int findSwapPairs(int N, int S[], int M, int X[], int Y[], int P[], int Q[]) {
      |                                                            ~~~~^~~
sorting.cpp:4:65: note: shadowed declaration is here
    4 | int S[1000]={4,3,2,1,0},X[1000]={0,0,0,0,0},Y[1000]={0,0,0,0,0},P[1000],Q[1000];
      |                                                                 ^
sorting.cpp:5:55: warning: declaration of 'Y' shadows a global declaration [-Wshadow]
    5 | int findSwapPairs(int N, int S[], int M, int X[], int Y[], int P[], int Q[]) {
      |                                                   ~~~~^~~
sorting.cpp:4:45: note: shadowed declaration is here
    4 | int S[1000]={4,3,2,1,0},X[1000]={0,0,0,0,0},Y[1000]={0,0,0,0,0},P[1000],Q[1000];
      |                                             ^
sorting.cpp:5:46: warning: declaration of 'X' shadows a global declaration [-Wshadow]
    5 | int findSwapPairs(int N, int S[], int M, int X[], int Y[], int P[], int Q[]) {
      |                                          ~~~~^~~
sorting.cpp:4:25: note: shadowed declaration is here
    4 | int S[1000]={4,3,2,1,0},X[1000]={0,0,0,0,0},Y[1000]={0,0,0,0,0},P[1000],Q[1000];
      |                         ^
sorting.cpp:5:30: warning: declaration of 'S' shadows a global declaration [-Wshadow]
    5 | int findSwapPairs(int N, int S[], int M, int X[], int Y[], int P[], int Q[]) {
      |                          ~~~~^~~
sorting.cpp:4:5: note: shadowed declaration is here
    4 | int S[1000]={4,3,2,1,0},X[1000]={0,0,0,0,0},Y[1000]={0,0,0,0,0},P[1000],Q[1000];
      |     ^
sorting.cpp:5:39: warning: unused parameter 'M' [-Wunused-parameter]
    5 | int findSwapPairs(int N, int S[], int M, int X[], int Y[], int P[], int Q[]) {
      |                                   ~~~~^
sorting.cpp:5:46: warning: unused parameter 'X' [-Wunused-parameter]
    5 | int findSwapPairs(int N, int S[], int M, int X[], int Y[], int P[], int Q[]) {
      |                                          ~~~~^~~
sorting.cpp:5:55: warning: unused parameter 'Y' [-Wunused-parameter]
    5 | int findSwapPairs(int N, int S[], int M, int X[], int Y[], int P[], int Q[]) {
      |                                                   ~~~~^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...