# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1085336 | guagua0407 | Sorting (IOI15_sorting) | C++17 | 1 ms | 600 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 <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)
# | 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... |