Submission #345130

# Submission time Handle Problem Language Result Execution time Memory
345130 2021-01-07T04:40:28 Z daniel920712 Rice Hub (IOI11_ricehub) C++14
Compilation error
0 ms 0 KB
#include "garden.h"
#include "gardenlib.h"
#include "gardenlib.h"
#include <vector>
#include <utility>
#include <algorithm>
using namespace std;
int con[100005];
vector < pair < int , int > > Next[100005];
pair < int , int > tra[2][31][100005];
int Father[100005];
bool F(int fa,int here,int how,int where,int deg)
{
    if(deg==how) return where==here;
    if(con[here]==1||fa!=Next[here][0].second) return F(here,Next[here][0].second,how,where,deg+1);
    else return F(here,Next[here][1].second,how,where,deg+1);
}
void count_routes(int N, int M, int P, int R[][2], int Q, int G[])
{
    int i,now=0,j,k;
    for(i=0;i<M;i++)
    {
        Next[R[i][0]].push_back(make_pair(i,R[i][1]));
        Next[R[i][1]].push_back(make_pair(i,R[i][0]));
        con[R[i][0]]++;
        con[R[i][1]]++;
    }
    for(i=0;i<N;i++)
    {
        sort(Next[i].begin(),Next[i].end());
        if(con[i]==1) Father[i]=-1;
        else Father[i]=Next[i][0].first;
    }
    for(i=0;i<N;i++)
    {
        tra[0][0][i]=make_pair(i,Next[i][0].second);
        if(Father[i]!=-1) tra[1][0][i]=make_pair(i,Next[i][1].second);
    }
    for(i=1;i<=30;i++)
    {
        for(j=0;j<N;j++)
        {
            if(tra[0][i-1][j].first==Father[tra[0][i-1][j].second]) tra[0][i][j]=tra[1][i-1][tra[0][i-1][j].second];
            else tra[0][i][j]=tra[0][i-1][tra[0][i-1][j].second];

            if(tra[1][i-1][j].first==Father[tra[1][i-1][j].second]) tra[1][i][j]=tra[1][i-1][tra[1][i-1][j].second];
            else tra[1][i][j]=tra[0][i-1][tra[1][i-1][j].second];
        }
    }

    /*for(i=0;i<Q;i++)
    {
        now=0;
        for(j=0;j<N;j++)
        {
            pair < int , int > tt=make_pair(-1,j);
            for(k=0;k<=30;k++)
            {
                if(G[i]&(1<<k))
                {
                    if(tt.first==Father[tt.second]) tt=tra[1][j][tt.second];
                    else tt=tra[0][j][tt.second];
                }
            }
            //printf("%lld %lld\n",j,tt.second);
            if(tt.second==P) now++;

        }
        answer(now);
    }*/

}
/*
6 6 0
1 2
0 1
0 3
3 4
4 5
1 5

1
3

2
*/


Compilation message

ricehub.cpp:1:10: fatal error: garden.h: No such file or directory
    1 | #include "garden.h"
      |          ^~~~~~~~~~
compilation terminated.