# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
206028 | Segtree | Sorting (IOI15_sorting) | C++14 | 7 ms | 504 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<iostream>
#include<algorithm>
#include<vector>
#include<queue>
using namespace std;
typedef long long ll;
#define chmin(a,b) a=min(a,b)
#define chmax(a,b) a=max(a,b)
#define all(x) x,begin(),x.end()
#define rep(i,n) for(int i=0;i<n;i++)
#define mod 1000000007
#define mad(a,b) a=(a+b)%mod
int findSwapPairs(int N,int S[],int M,int X[],int Y[],int P[],int Q[]){
rep(i,M)P[i]=Q[i]=0;
for(int i=0;i<N;i++){
ll p;
for(int j=0;j<N;j++)if(S[j]==i)p=j;
P[i]=i,Q[i]=p;
swap(S[i],S[p]);
}
ll R=N;
//rep(i,R)cout<<"PQ:"<<P[i]<<" "<<Q[i]<<endl;
return R;
}/*
int main(){
int n,s[100],m,x[1000],y[1000],p[1000],q[1000];
cin>>n;
rep(i,n)cin>>s[i];
cin>>m;
rep(i,m){
cin>>x[i]>>y[i];
}
cout<<"R="<<findSwapPairs(n,s,m,x,y,p,q)<<endl;
}*/
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... |