Submission #127667

#TimeUsernameProblemLanguageResultExecution timeMemory
127667chubyxdxdSimurgh (IOI17_simurgh)C++11
0 / 100
2 ms376 KiB
#include "simurgh.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll,ll> ii; std::vector<int> find_roads(int n, std::vector<int> u, std::vector<int> v){ int tam=v.size(); //initset(tam); map<int,ii> mp; set<int> se; for(int i=0; i<tam; i++){ //unionset(u[i],v[i]); mp[i]=ii(u[i],v[i]); //cout<<i<<" = "<<u[i]<<" "<<v[i]<<endl; } for(int i=pow(2,n-1)-1;i<(1<<tam);i++){ int h=__builtin_popcount(i); //cout<<i<<" tiene "<<h<<" bits prendidos "<<endl; if(h!=n-1){ continue; } else{ se.clear(); vector<int> r; //cout<<i<<" = "<<h<<endl; for(ll j=0;j<tam;j++){ if(i&(1<<j)){ r.push_back(j); } } int l=r.size(); /*for(int j=0;j<l;j++){ cout<<r[j]<<" "; } cout<<endl;*/ for(int j=0;j<l;j++){ se.insert(mp[r[j]].first); se.insert(mp[r[j]].second); } /*set<int>::iterator it; for(it=se.begin();it!=se.end();it++){ cout<<*it<<" "; } cout<<endl; cout<<endl;*/ ll k=se.size(); if(k==n){ /*set<ll>::iterator it; for(it=se.begin();it!=se.end();it++){ cout<<*it<<" "; } cout<<endl; cout<<endl; for(int j=0;j<l;j++){ cout<<r[j]<<" "; } cout<<endl; //cout<<endl;*/ //se.clear(); //cout<<i<<endl; ll common=count_common_roads(r); if(common==n-1){ //cout<<f<<endl; return r; } } } } //return r; //int common=count_common_roads(r); }

Compilation message (stderr)

simurgh.cpp: In function 'std::vector<int> find_roads(int, std::vector<int>, std::vector<int>)':
simurgh.cpp:73:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
#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...