Submission #864452

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
8644522023-10-23 02:41:35maks007Paths (BOI18_paths)C++14
100 / 100
523 ms73820 KiB
#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 ++) {
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...