Submission #1056420

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
10564202024-08-13 09:21:25user736482The Xana coup (BOI21_xanadu)C++17
5 / 100
405 ms9580 KiB
#include<bits/stdc++.h>
using namespace std;
long long a,b,c,t,n;
int ans=1e9;
set<pair<int,int>>s;
vector<int>tree[100007];
vector<int>leaves;
vector<bool>st;
long long buttons[100007];
int cost[100007][2][2];//vertice, iflit,ifpressed
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
cin>>n;
for(int i=1;i<n;i++){
cin>>a>>b;
tree[a].push_back(b);
tree[b].push_back(a);
buttons[a]+=1<<(b-1);
buttons[b]+=1<<(a-1);
}
for(int i=1;i<=n;i++){
if(tree[i].size()==1)
leaves.push_back(i);
buttons[i]+=1<<(i-1);
cin>>a;
st.push_back(a);
}
reverse(st.begin(),st.end());
int a=0;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

xanadu.cpp: In function 'int main()':
xanadu.cpp:31:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<bool>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   31 |     for(int i=0;i<st.size();i++){
      |                 ~^~~~~~~~~~
#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...