Submission #1056820

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
10568202024-08-13 11:34:55kachim2The Xana coup (BOI21_xanadu)C++17
0 / 100
1058 ms5756 KiB
#include<bits/stdc++.h>
using namespace std;
vector<vector<long>> tree;
long N; long bst = LONG_MAX;
int main(){
long n;
cin >> n;
N=n;
tree.resize(n);
vector<bool> lit(n, 0);
for(long i = 0; i < n-1; i++){
long a, b;
cin >> a >> b;
tree[a-1].push_back(b-1);
tree[b-1].push_back(a-1);
}
for(long i = 0; i < n; i++){
long x;cin >> x; lit[i] = x;
}
for(long i = 1; i < 1<<(n); i++){
auto flit = lit;
long fi = i;
long cnt = 0;
long scntl= 0;
while(fi!=0){
if(fi&1){
scntl++;
for(auto j : tree[cnt]){
flit[j] = !flit[j];
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
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...
#Verdict Execution timeMemoryGrader output
Fetching results...