# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
427975 | 2021-06-15T06:29:33 Z | haxorman | Sorting (IOI15_sorting) | C++14 | 143 ms | 368 KB |
#include "sorting.h" #include "bits/stdc++.h" using namespace std; const int mxN = 2e5 + 7; int n, m, arr[mxN]; 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) { arr[i] = S[i]; } sort(S, S + n); int R = 0, ind = 0; for (int iter = 1; iter <= 50; ++iter) { for (int i = 0; i < n; ++i) { for (int j = 0; j < n; ++j) { if (arr[j] == S[i] && i != j) { swap(arr[j], arr[i]); P[ind] = j, Q[ind] = i; ++R; ++ind; break; } } } } return R; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | Output is correct |
2 | Correct | 1 ms | 308 KB | Output is correct |
3 | Correct | 1 ms | 204 KB | Output is correct |
4 | Correct | 1 ms | 204 KB | Output is correct |
5 | Correct | 1 ms | 204 KB | Output is correct |
6 | Correct | 1 ms | 312 KB | Output is correct |
7 | Correct | 1 ms | 204 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | Output is correct |
2 | Correct | 1 ms | 308 KB | Output is correct |
3 | Correct | 1 ms | 204 KB | Output is correct |
4 | Correct | 1 ms | 204 KB | Output is correct |
5 | Correct | 1 ms | 204 KB | Output is correct |
6 | Correct | 1 ms | 312 KB | Output is correct |
7 | Correct | 1 ms | 204 KB | Output is correct |
8 | Correct | 1 ms | 204 KB | Output is correct |
9 | Correct | 1 ms | 204 KB | Output is correct |
10 | Correct | 2 ms | 332 KB | Output is correct |
11 | Correct | 1 ms | 316 KB | Output is correct |
12 | Correct | 2 ms | 332 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | Output is correct |
2 | Incorrect | 1 ms | 204 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | Output is correct |
2 | Correct | 1 ms | 308 KB | Output is correct |
3 | Correct | 1 ms | 204 KB | Output is correct |
4 | Correct | 1 ms | 204 KB | Output is correct |
5 | Correct | 1 ms | 204 KB | Output is correct |
6 | Correct | 1 ms | 312 KB | Output is correct |
7 | Correct | 1 ms | 204 KB | Output is correct |
8 | Correct | 1 ms | 204 KB | Output is correct |
9 | Correct | 1 ms | 204 KB | Output is correct |
10 | Correct | 2 ms | 332 KB | Output is correct |
11 | Correct | 1 ms | 316 KB | Output is correct |
12 | Correct | 2 ms | 332 KB | Output is correct |
13 | Correct | 1 ms | 204 KB | Output is correct |
14 | Incorrect | 1 ms | 204 KB | Output isn't correct |
15 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 143 ms | 368 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 143 ms | 368 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |