| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 821269 | vjudge1 | Simurgh (IOI17_simurgh) | C++17 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "simurgh.h"
#include <bits/stdc++.h>
using namespace std;
const int N = 100;
int us[N] , nn ;
vector<int>ans;
vector<pair<int,int>>vc[N];
deque<int>d;
void dfs(int n){
us[n] = 1;
for(auto to : vc[n]){
if(!us[to.first] && ans.size() == 0)
d.push_back(to.second) , dfs(to.first);
}
// cout<<nn<<" "<<n<<" "<<d.size()<<"\n";
if(d.size() == (nn - 1)){
if(count_common_roads(d) == nn - 1){
for(auto to : d)
ans.push_back(to);
}
}
if(d.size())
d.pop_back();
us[n] = 0;
}
vector<int> find_roads(int n , vector<int>u , vector<int>v){
int q , i , j , m , z ,s = 0 , f , l , r , k , x , y , mn = 1e9 , mx = 0;
m = u.size();
nn = n;
for(i = 0; i < m; i++){
vc[u[i]].push_back({v[i] , i});
vc[v[i]].push_back({u[i] , i});
}
for(i = 0;i < n; i++)
dfs(i);
return ans;
}
/*
void solve(){
int q , i , j , m ,n, z ,s = 0 , f , l , r , k , x , y , mn = 1e18 , mx = 0;
vector<int>u = find_roads(4, {0, 0, 0, 1, 1, 2}, {1, 2, 3, 2, 3, 3});
//cout<<u.size()<<"\n";
for(auto to : u)
cout<<to<<"\n";
}
int main(){
/* #ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
*/
/*int t = 1;
//cin>>t;
while(t--)
{
solve();
}
}
// Author : حسن
*/
