# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
684889 | happypotato | Permutation (APIO22_perm) | C++17 | 2 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;
void discretise(vector<int> &v) {
map<int, int> mp;
for (int i = 0; i < (int)(v.size()); i++) {
mp[v[i]] = i;
}
int cnt = 0;
for (pair<int, int> cur : mp) {
v[cur.second] = cnt++;
}
}
vector<int> ans;
int multi, add, buff;
void recur(long long k) {
// cerr << "DOING " << k << endl;
if (k == 2) {
ans = {0};
return;
} else if (k == 3) {
ans = {0, -1000}; add -= 1000;
return;
} else if (k == 7) {
ans = {-1000, -2000, 0, -3000}; add -= 3000;
return;
}
if (k % 4 == 3) {
recur(k / 4);
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |