# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
744078 | veehz | Permutation (APIO22_perm) | C++17 | 13 ms | 340 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 "perm.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
void normalize(vector<float>& a) {
vector<float> b = a;
sort(b.begin(), b.end());
map<float, int> mp;
for (int i = 0; i < (int)b.size(); i++) mp[b[i]] = i;
for (int i = 0; i < (int)a.size(); i++) a[i] = mp[a[i]];
}
void insert(vector<float>& a, int x) {
int n = a.size();
if (x == 0) {
a.push_back(n);
a.push_back(n + 1);
return;
} else if (x == 1) {
a.push_back(n);
a.push_back(n + 1);
a.push_back(-1);
normalize(a);
return;
} else if (x == 2) {
a.push_back(n);
a.push_back(-1);
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |