# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
429740 | SuckTinHock | Beautiful row (IZhO12_beauty) | C++17 | 1120 ms | 164364 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>
#define int long long
using namespace std;
int n;
int cnt2[25], cnt3[25];
int dp[1 << 20][20];
vector<int> G[25];
int ter(int x)
{
int res = 0;
while (x > 0)
{
res += (x % 3 == 1);
x /= 3;
}
return res;
}
void build()
{
for (int i = 1; i < n; ++i)
{
for (int j = 0; j < i; ++j)
{
if (cnt2[i] == cnt2[j] || cnt3[i] == cnt3[j])
{
G[i].push_back(j);
G[j].push_back(i);
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |