# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
639938 | piOOE | Scales (IOI15_scales) | C++17 | 517 ms | 7888 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 <bits/stdc++.h>
#include "scales.h"
using namespace std;
constexpr int N = 6, M = 720, P[]{1, 3, 9, 27, 81, 243, 729};
map<vector<int>, array<int, 4>> compare;
vector<int> perm[M], inv[M];
int ans[N];
void sort(vector<int> &p, int &i, int &j, int &k) {
if (p[i] > p[j]) {
swap(i, j);
}
if (p[i] > p[k]) {
swap(i, k);
}
if (p[j] > p[k]) {
swap(j, k);
}
}
int heaviest(vector<int> &p, int i, int j, int k) {
sort(p, i, j, k);
return k;
}
int median(vector<int> &p, int i, int j, int k) {
sort(p, i, j, k);
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |