| # | Time | Username | Problem | Language | Result | Execution time | Memory | 
|---|---|---|---|---|---|---|---|
| 135326 | StevenH | Sorting (IOI15_sorting) | C++14 | 4 ms | 380 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 "sorting.h"
#include <algorithm>
#include <cstdio>
using namespace std;
int ele[1000];
void swap(int &x ,int &y)
{int t=x; x=y; y=t;}
int comp(int x,int y)
{return x<y;}
int findSwapPairs(int N, int S[], int M, int X[], int Y[], int P[], int Q[]) {
	int R=0;
	for(int i=N-1; i>1; i--)
	{
		swap(S[0],S[1]);
		int mx=-1,k;
		for(int j=0;j<=i;j++)
		{
			if(S[j]>mx)
			{
                mx=S[j];
                k=j;
			}
        }
		P[R]=k;
		Q[R]=i;
		R++;
		swap(S[i],S[k]);
	}
	if (X[0]==0 && Y[0]==1)
	{
		if(S[0]>S[1])
		{
			P[R]=0;
			Q[R]=0;
			R++;
			swap(S[0],S[1]);
			swap(S[0],S[0]);
		}
	}
	for (int i = 0; i < N; ++i)
		printf("%d ",S[i]);
	printf("\n");
	return R;
}
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... | ||||
