# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
864452 | maks007 | Paths (BOI18_paths) | C++14 | 523 ms | 73820 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"
using namespace std;
#define int long long
vector <int> color;
vector <vector <int>> g, dp;
signed main () {
int n, m, k;
cin >> n >> m >> k;
color.resize(n);
g.resize(n);
dp.resize(n, vector <int> (1 << k, 0));
for(int i = 0; i < n; i ++) {
cin >> color[i];
color[i] --;
}
for(int i = 0, u, v; i < m; i ++) {
cin >> u >> v;
u --, v --;
g[u].push_back(v);
g[v].push_back(u);
if(color[u] == color[v]) continue;
dp[v][(1 << color[u]) ^ (1 << color[v])] += 1;
dp[u][(1 << color[u]) ^ (1 << color[v])] += 1;
}
for(int mask = 0; mask < (1 << k); mask ++) {
for(int i = 0; i < n; i ++) {
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |