Submission #1011676

#TimeUsernameProblemLanguageResultExecution timeMemory
1011676irmuunSorting (IOI15_sorting)C++17
20 / 100
1 ms348 KiB
#include<bits/stdc++.h> #include "sorting.h" using namespace std; #define ll long long #define pb push_back #define ff first #define ss second #define all(s) s.begin(),s.end() #define rall(s) s.rbegin(),s.rend() int findSwapPairs(int n, int S[], int m, int X[], int Y[], int P[], int Q[]){//P Q is answers int r=0; while(true){ bool found=false; for(int i=0;i<n;i++){ if(S[i]!=i){ found=true; P[r]=i; Q[r]=S[i]; swap(S[P[r]],S[Q[r]]); r++; break; } } if(!found) break; } return r; }

Compilation message (stderr)

sorting.cpp: In function 'int findSwapPairs(int, int*, int, int*, int*, int*, int*)':
sorting.cpp:13:39: warning: unused parameter 'm' [-Wunused-parameter]
   13 | int findSwapPairs(int n, int S[], int m, int X[], int Y[], int P[], int Q[]){//P Q is answers
      |                                   ~~~~^
sorting.cpp:13:46: warning: unused parameter 'X' [-Wunused-parameter]
   13 | int findSwapPairs(int n, int S[], int m, int X[], int Y[], int P[], int Q[]){//P Q is answers
      |                                          ~~~~^~~
sorting.cpp:13:55: warning: unused parameter 'Y' [-Wunused-parameter]
   13 | int findSwapPairs(int n, int S[], int m, int X[], int Y[], int P[], int Q[]){//P Q is answers
      |                                                   ~~~~^~~
#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...