# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
132341 | reda | Sorting (IOI15_sorting) | C++14 | 2 ms | 376 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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[], int p[], 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());
int i=0,j=0;
while(i<N)
{
if(v[i].first != S[i]){i++;p[j]=0;q[j]=0;}
else {
q[j]=i;
p[j]=v[i].second;
c++;
j++;
i++;
}
}
return c;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |