# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
620989 | 2022-08-03T10:53:55 Z | Hazem | Sorting (IOI15_sorting) | C++14 | 6 ms | 340 KB |
#include <bits/stdc++.h> using namespace std; int findSwapPairs(int N, int S[], int M, int X[], int Y[], int P[], int Q[]) { int n = N; int cur = 0; swap(S[0],S[1]); for(int i=0;i<n;i++) if(S[i]==0){ P[cur] = 1; Q[cur] = i; cur++; swap(S[i],S[1]); } swap(S[0],S[1]); for(int i=0;i<n;i++) if(S[i]==1){ P[cur] = 1; Q[cur] = i; cur++; swap(S[i],S[1]); } for(int i=2;i<n;i++) for(int j=2;j<n;j++) if(i==j) continue; else if(S[j]==i){ P[cur] = i; Q[cur] = j; cur++; swap(S[i],S[j]); } if((cur&1)){ swap(S[0],S[1]); P[cur] = 0; Q[cur] = 0; cur++; } return cur; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 212 KB | Integer parameter [name=R] equals to 2, violates the range [0, 1] |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 212 KB | Integer parameter [name=R] equals to 2, violates the range [0, 1] |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 212 KB | Output is correct |
2 | Correct | 1 ms | 212 KB | Output is correct |
3 | Correct | 1 ms | 212 KB | Output is correct |
4 | Correct | 1 ms | 212 KB | Output is correct |
5 | Incorrect | 1 ms | 212 KB | Output isn't correct |
6 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 212 KB | Integer parameter [name=R] equals to 2, violates the range [0, 1] |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 6 ms | 340 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 6 ms | 340 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |