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 <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <string>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <queue>
#include <deque>
#include <list>
#include "simurgh.h"
using namespace std;
typedef int ll;
typedef unsigned long long int ull;
#define REP(i,a,b) for(ll i=(ll)a; i<(ll)b; i++)
#define pb push_back
#define mp make_pair
#define pl pair<ll,ll>
#define ff first
#define ss second
#define whole(x) x.begin(),x.end()
#define DEBUG(i) cout<<"Pedro Is The Master "<<i<<endl
#define INF 100000000
ll insig;
#define In(vecBRO, LENBRO) REP(IBRO,0,LENBRO) {cin>>insig; vecBRO.pb(insig);}
void Out(vector<ll> x) {REP(i,0,x.size()) {cout<<x[i]<<" ";} cout<<endl;}
ll N,M; vector<pl> ed; vector<ll> ans;
void f(vector<int> a)
{
if(!ans.empty()) {return;}
if(a.size()==N-1)
{
int common = count_common_roads(a);
if(common==N-1) {ans=a; return;}
}
else
{
ll last=0LL; if(a.size()>0) {last=a[a.size()-1]+1;}
REP(i,last,M)
{
a.pb(i); f(a); a.pop_back();
}
}
return;
}
vector<int> find_roads(int n, vector<int> u, vector<int> v)
{
N=(ll) n; M=u.size();
REP(i,0,M) {ed.pb(mp(u[i],v[i]));}
vector<int> em;
f(em);
return ans;
}
Compilation message (stderr)
simurgh.cpp: In function 'void f(std::vector<int>)':
simurgh.cpp:34:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if(a.size()==N-1)
~~~~~~~~^~~~~
# | 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... |