답안 #296957

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
296957 2020-09-11T05:53:01 Z Muhammetali Simurgh (IOI17_simurgh) C++11
0 / 100
1 ms 384 KB
#include "simurgh.h"
#include <bits/stdc++.h>
#define mp make_pair
#define f first
#define s second
#define sz(x) (int)(x).size()
#define rsz resize
#define ins insert
#define ft front()
#define bk back()
#define pf push_front
#define pb push_back
#define eb emplace_back
#define lb lower_bound
#define ub upper_bound
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pi;
typedef pair<ll,ll> pl;
typedef vector<int> vi;
typedef vector<bool> vb;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
bool vis[1000];
vi res,barla;
vpi node[1000];
void func(int h,int n,int m)
{
	if (sz(barla)==n-1)
	{
		for(int i=0;i<sz(barla);i++)
		{
			cout << barla[i] << " ";
		}
		cout << "\n";
		int g=count_common_roads(barla);
		if (g==n-1)
		{
			for (int i=0;i<sz(barla);i++) res.pb(barla[i]);
		}
		return;
	}
	for (int i=0;i<sz(node[h]);i++)
	{
		if (!vis[node[h][i].f])
		{
			vis[node[h][i].f]=1;
			barla.pb(node[h][i].s);
			func(node[h][i].f,n,m);
			vis[node[h][i].f]=0;
			barla.pop_back();
		}
	}
}
vector<int> find_roads(int n, vector<int> u, vector<int> v)
{
	int m=sz(u);
	for (int i=0;i<m;i++)
	{
		node[u[i]].pb({v[i],i});
		node[v[i]].pb({u[i],i});
	}
	vis[0]=1;
	func(0,n,m);
	return res;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 384 KB Security Violation! Don't try to hack
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 384 KB Security Violation! Don't try to hack
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 384 KB Security Violation! Don't try to hack
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 384 KB Security Violation! Don't try to hack
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 384 KB Security Violation! Don't try to hack
2 Halted 0 ms 0 KB -