Submission #1085336

#TimeUsernameProblemLanguageResultExecution timeMemory
1085336guagua0407Sorting (IOI15_sorting)C++17
0 / 100
1 ms600 KiB
#include "sorting.h" #include <bits/stdc++.h> using namespace std; #define ll long long #define pii pair<int,int> #define f first #define s second #define all(x) x.begin(),x.end() #define _ ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); vector<pair<int,int>> vec; vector<int> val; bool comp(int a,int b){ if(val[a]<val[b]){ return true; } else{ swap(val[a],val[b]); return false; } } int findSwapPairs(int N, int S[], int M, int X[], int Y[], int P[], int Q[]) { val.resize(N); for(int i=0;i<N;i++){ val[i]=S[i]; } vector<int> p; for(int i=0;i<N;i++){ p.push_back(i); } sort(all(p),comp); for(int i=0;i<(int)vec.size();i++){ P[i]=vec[i].f; Q[i]=vec[i].s; } return (int)vec.size(); }

Compilation message (stderr)

sorting.cpp: In function 'int findSwapPairs(int, int*, int, int*, int*, int*, int*)':
sorting.cpp:24:39: warning: unused parameter 'M' [-Wunused-parameter]
   24 | int findSwapPairs(int N, int S[], int M, int X[], int Y[], int P[], int Q[]) {
      |                                   ~~~~^
sorting.cpp:24:46: warning: unused parameter 'X' [-Wunused-parameter]
   24 | int findSwapPairs(int N, int S[], int M, int X[], int Y[], int P[], int Q[]) {
      |                                          ~~~~^~~
sorting.cpp:24:55: warning: unused parameter 'Y' [-Wunused-parameter]
   24 | 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...