Submission #432832

#TimeUsernameProblemLanguageResultExecution timeMemory
432832balbitSorting (IOI15_sorting)C++14
0 / 100
1 ms460 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 #ifdef BALBIT #define bug(...) cerr<<"#"<<__LINE__<<": "<<#__VA_ARGS__<<"- ", _do(__VA_ARGS__) template<typename T> void _do( T && x) {cerr<<x<<endl;} template<typename T, typename ...S> void _do( T && x, S && ...y) {cerr<<x<<", "; _do(y...);} #else #define bug(...) #endif // BALBIT #define ALL(x) (x).begin(), (x).end() #define SZ(x) (int )((x).size()) #define pb push_back #define REP(i,n) for (int i = 0; i<n; ++i) #define REP1(i,n) for (int i = 1; i<=n; ++i) #define MX(a,b) a = max(a,b) #define MN(a,b) a = min(a,b) //signed main(){bug(1,2);} int findSwapPairs(int n, int S[], int M, int X[], int Y[], int P[], int Q[]) { REP(i,n) { assert(X[i] == 0 && Y[i] == 0); for (int j = i; j<n; ++j) { if (S[j] ==i) { P[i] = i; Q[i] = j; swap(S[i], S[j]); break; } } } return n; }

Compilation message (stderr)

sorting.cpp: In function 'int findSwapPairs(int, int*, int, int*, int*, int*, int*)':
sorting.cpp:30:39: warning: unused parameter 'M' [-Wunused-parameter]
   30 | 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...