# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
29476 | inqr | Tropical Garden (IOI11_garden) | C++14 | 2574 ms | 34468 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 "garden.h"
#include "gardenlib.h"
#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define rt insert
#define st first
#define nd second
using namespace std;
vector < int > ed[150005];
vector < pair < int , int > > r[2][150005];
vector < int > p[2];
int cycle1=-1,cycle2=-1;
void dfs(pair<int,int> vn,int rn,pair<int,int> &orv){
//printf("vn = %d %d rn=%d orv= %d %d\n",vn.st,vn.nd,rn,orv.st,orv.nd);
if(vn==orv&&rn!=0)
if(orv.nd==0){cycle1=rn;return;}
else {cycle2=rn;return;}
if(vn.nd==0)
if(orv.nd==0)p[0][vn.st]=rn;
else p[1][vn.st]=rn;
if(vn.nd==0)
for(int i=0;i<r[0][vn.st].size();i++)
dfs(r[0][vn.st][i],rn+1,orv);
else
for(int i=0;i<r[1][vn.st].size();i++)
dfs(r[1][vn.st][i],rn+1,orv);
}
void count_routes(int N, int M, int P, int R[][2], int Q, int G[])
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... |