Submission #132332

#TimeUsernameProblemLanguageResultExecution timeMemory
132332redaSorting (IOI15_sorting)C++14
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> using namespace std ; # include "sorting.h" vector<pair<int,int>> v; int findSwapPairs(int N, int S[], int M, int X[], int Y, vector<int> P, vector<int> q) { for(int i=0;i<N;i++) { v.push_back(make_pair(S[i],i); } int c=0; sort(v.begin(),v.end()); for(int i=0;i<N;i++) { if(v[i].second != S[i])continue; q.push_back(i); p.push_back(v[i].second()); c++; } return c; }

Compilation message (stderr)

sorting.cpp: In function 'int findSwapPairs(int, int*, int, int*, int, std::vector<int>, std::vector<int>)':
sorting.cpp:9:38: error: expected ')' before ';' token
         v.push_back(make_pair(S[i],i);
                                      ^
sorting.cpp:17:9: error: 'p' was not declared in this scope
         p.push_back(v[i].second());
         ^
sorting.cpp:17:33: error: expression cannot be used as a function
         p.push_back(v[i].second());
                                 ^
sorting.cpp:5:39: warning: unused parameter 'M' [-Wunused-parameter]
 int findSwapPairs(int N, int S[], int M, int X[], int  Y, vector<int> P, vector<int> q)
                                       ^
sorting.cpp:5:48: warning: unused parameter 'X' [-Wunused-parameter]
 int findSwapPairs(int N, int S[], int M, int X[], int  Y, vector<int> P, vector<int> q)
                                                ^
sorting.cpp:5:56: warning: unused parameter 'Y' [-Wunused-parameter]
 int findSwapPairs(int N, int S[], int M, int X[], int  Y, vector<int> P, vector<int> q)
                                                        ^
sorting.cpp:5:71: warning: unused parameter 'P' [-Wunused-parameter]
 int findSwapPairs(int N, int S[], int M, int X[], int  Y, vector<int> P, vector<int> q)
                                                                       ^