# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
102632 | wxh010910 | Scales (IOI15_scales) | C++17 | 334 ms | 16816 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;
const int N = 6;
const int M = 720;
const int S = 5184;
const vector<int> p3 = {1, 3, 9, 27, 81, 243, 729};
vector<vector<int>> value(M, vector<int>(S, -1));
map<pair<vector<int>, int>, int> tree;
vector<vector<int>> all(M);
vector<bool> valid(S);
vector<int> choices;
bool dfs(vector<int> remain, int depth) {
if ((int) remain.size() > p3[depth]) {
return false;
}
if ((int) remain.size() == 1) {
return true;
}
if (tree.count(make_pair(remain, depth))) {
return tree[make_pair(remain, depth)] != -1;
}
for (auto p : choices) {
vector<vector<int>> partition(N);
for (auto i : remain) {
partition[value[i][p]].push_back(i);
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |