# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
127635 | chubyxdxd | Simurgh (IOI17_simurgh) | C++11 | 2 ms | 376 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 "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){
ll tam=u.size();
//initset(tam);
map<ll,ii> mp;
set<ll> se;
for(ll i = 0; i<tam; i++){
//unionset(u[i],v[i]);
mp[i]=ii(v[i],u[i]);
}
vector<int> r;
for(ll i=0;i<(1<<tam);i++){
ll h=__builtin_popcount(i);
se.clear();
r.clear();
if(h!=n-1){
continue;
}
else{
for(int j=0;j<tam;j++){
if(i&(1<<j)){
r.push_back(j);
}
}
for(int j=0;j<n-1;j++){
se.insert(mp[r[j]].first);
se.insert(mp[r[j]].second);
}
int k=se.size();
if(k==n-1){
int common=count_common_roads(r);
if(common==n-1){
return r;
}
}
}
}
//int common=count_common_roads(r);
}
Compilation message (stderr)
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |