# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1075125 | 2024-08-25T18:48:03 Z | ArthuroWich | Sorting (IOI15_sorting) | C++17 | 3 ms | 1664 KB |
#include "sorting.h" #include<bits/stdc++.h> using namespace std; int findSwapPairs(int n, int p[], int M, int X[], int Y[], int P[], int Q[]) { vector<pair<int, int>> ans; int d = 0; for (int i = n-1; i >= 0; i++) { if (p[i] == i) { continue; } while(p[i] != i) { int j = p[i]; ans.push_back({i, j}); swap(p[i], p[j]); if (is_sorted(p, p+n)) { break; } swap(X[d], Y[d]); d++; } } for (int i = 0; i < ans.size(); i++) { P[i] = ans[i].first; Q[i] = ans[i].second; } return ans.size(); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 0 ms | 344 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 0 ms | 344 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 344 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 0 ms | 344 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 3 ms | 1664 KB | Execution killed with signal 6 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 3 ms | 1664 KB | Execution killed with signal 6 |
2 | Halted | 0 ms | 0 KB | - |