# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
831867 | 2023-08-20T16:26:54 Z | ttamx | Sorting (IOI15_sorting) | C++14 | 1 ms | 440 KB |
#include "sorting.h" #include<bits/stdc++.h> using namespace std; int n,m; vector<int> s; int findSwapPairs(int N, int S[], int M, int X[], int Y[], int P[], int Q[]) { n=N,m=M; for(int i=0;i<n;i++)s.emplace_back(S[i]); for(int i=0;i<m;i++)swap(X[i],Y[i]); vector<pair<int,int>> ans; for(int i=0;i<n;i++){ while(s[i]!=i){ ans.emplace_back(i,s[i]); swap(s[i],s[s[i]]); } } while(ans.size()<n)ans.emplace_back(0,0); for(int i=0;i<n;i++)tie(P[i],Q[i])=ans[i]; return n; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 212 KB | Output is correct |
2 | Correct | 1 ms | 296 KB | Output is correct |
3 | Correct | 0 ms | 212 KB | Output is correct |
4 | Incorrect | 0 ms | 300 KB | Output isn't correct |
5 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 212 KB | Output is correct |
2 | Correct | 1 ms | 296 KB | Output is correct |
3 | Correct | 0 ms | 212 KB | Output is correct |
4 | Incorrect | 0 ms | 300 KB | Output isn't correct |
5 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 296 KB | Output is correct |
2 | Incorrect | 0 ms | 288 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 212 KB | Output is correct |
2 | Correct | 1 ms | 296 KB | Output is correct |
3 | Correct | 0 ms | 212 KB | Output is correct |
4 | Incorrect | 0 ms | 300 KB | Output isn't correct |
5 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 440 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 440 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |