# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1053707 | Osplei | Sorting (IOI15_sorting) | C++17 | 0 ms | 348 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 <bits/stdc++.h>
using namespace std;
#define pb push_back
typedef long long ll;
typedef pair <ll, ll> LL;
ll mod = 1e9 + 7;
int findSwapPairs(int N, int S[], int M, int X[], int Y[], int P[], int Q[]) {
P[0] = 0;
Q[0] = 0;
vector <int> values;
int ans = 0;
for (ll i = 0; i < N; i++) values.pb(S[i]);
sort(values.begin(), values.end());
for (ll i = 0; i < N; i++) if (values[i] != S[i]) ans++;
if (ans == 0) return 0;
return ans - 1;
}
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... |