# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
33815 | mohammad_kilani | Simurgh (IOI17_simurgh) | C++14 | 0 ms | 2024 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;
vector<int> r , ans , u , v;
int n , m;
void calc(int i){
if(r.size() >= n) return;
if(i == m){
if(r.size() < n -1) return;
bool can[10] = {0};
for(int i=0;i<r.size();i++){
can[u[r[i]]] = 1;
can[v[r[i]]] = 1;
}
for(int i=0;i<n;i++) if(can[i] == false) return;
int cur = count_common_roads(r);
if(cur == n-1){
ans = r;
}
return ;
}
r.push_back(i);
calc(i+1);
r.pop_back();
calc(i+1);
}
std::vector<int> find_roads(int N, std::vector<int> U, std::vector<int> V) {
u = U;
v = V;
n = N;
m = u.size();
r.clear();
calc(0);
return ans;
}
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... |