# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
68693 | mirbek01 | Simurgh (IOI17_simurgh) | C++17 | 3 ms | 412 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> find_roads(int n, vector<int> u, vector<int> v) {
vector <int> ans, id;
int m = u.size();
for(int i = 0; i < n - 1; i ++)
ans.push_back(i);
for(int i = 0; i < m; i ++)
id.push_back(i);
int ct = count_common_roads(ans);
if(ct < n - 1){
for(int i = 0; i < n - 1; i ++){
for(int j = 0; j < n - 1; j ++){
ans[j] = id[j];
}
int cn = count_common_roads(ans);
for(int j = n - 1; j < id.size(); j ++){
swap(id[i], id[j]);
for(int k = 0; k < n - 1; k ++){
ans[k] = id[k];
}
int cnt = count_common_roads(ans);
if(cnt > cn){
break;
}
swap(id[i], id[j]);
}
}
}
for(int i = 0; i < n - 1; i ++)
ans[i] = id[i];
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... |