Submission #59203

# Submission time Handle Problem Language Result Execution time Memory
59203 2018-07-21T06:11:07 Z Mikaeel Amusement Park (JOI17_amusement_park) C++17
Compilation error
0 ms 0 KB
#include "Joi.h"
#include<bits/stdc++.h>
#define rep(i,l,r) for(int i=l;i<r;i++)
#define put(x) cout<<#x<<" = "<<x<<endl;
#define pb push_back
#define bit(x,i) ((x>>i)&1ll)
using namespace std;
typedef long long num;
typedef pair<int,int> point;
const int maxn=1e4+10,lg=60;
vector<int> G[maxn];
int te=0;
num x;
bool mark[maxn];
void dfs(int a){
    mark[a]=1;
    MessageBoard(a,bit(x,te));
    te=(te+1)%lg;
    for(int b:G[a]){
	if(!mark[b]){
	    dfs(b);
	}
    }
}

void Joi(int N, int M, int A[], int B[], num X, int T) {
    x=X;
    for(int i = 0; i < M; i++){
	G[A[i]].pb(B[i]);
	G[B[i]].pb(A[i]);
    }
    dfs(0);
}
#include "Ioi.h"
#include<bits/stdc++.h>
#define rep(i,l,r) for(int i=l;i<r;i++)
#define put(x) cout<<#x<<" = "<<x<<endl;
#define pb push_back
#define bit(x,i) ((x>>i)&1ll)
using namespace std;
typedef long long num;
typedef pair<int,int> point;
const int maxn=1e4+10,lg=60;
vector<int> G0[maxn];
int te0=0;
num x0;
bool mark0[maxn];
int v,t[maxn],size[maxn],par[maxn];
int root;

void dfs0(int a){
    mark0[a]=1;
    t[a]=te0;
    te0=(te0+1)%lg;
    size[a]=1;
    for(int b:G0[a]){
	if(!mark0[b]){
	    par[b]=a;
	    dfs0(b);
	    size[a]+=size[b];
	}
    }
}
int ss=0;
void dfs1(int a){
    if(ss==lg) return;
    mark0[a]=1;
    if(v){
	x0|=1<<t[a];
    }
    ss++;
    for(int b:G0[a]){
	if(!mark0[b]){
	    if(ss<lg) v=Move(b);
	    dfs1(b);
	    if(ss<lg) v=Move(b);
	}
    }
}
long long Ioi(int N, int M, int A[], int B[], int P, int V, int T) {
    v=V;
    for(int i = 0; i < M; i++){
	G0[A[i]].pb(B[i]);
	G0[B[i]].pb(A[i]);
    }
    dfs0(0);
    fill(mark0,mark0+N,0);
    root=P;
    while(size[root]<lg){
	root=par[root];
	v=Move(root);
    }
    dfs1(root);
    return x0;
}

Compilation message

Ioi.cpp: In function 'void dfs0(int)':
Ioi.cpp:22:5: error: reference to 'size' is ambiguous
     size[a]=1;
     ^~~~
Ioi.cpp:15:15: note: candidates are: int size [10010]
 int v,t[maxn],size[maxn],par[maxn];
               ^~~~
In file included from /usr/include/c++/7/string:51:0,
                 from /usr/include/c++/7/bits/locale_classes.h:40,
                 from /usr/include/c++/7/bits/ios_base.h:41,
                 from /usr/include/c++/7/ios:42,
                 from /usr/include/c++/7/istream:38,
                 from /usr/include/c++/7/sstream:38,
                 from /usr/include/c++/7/complex:45,
                 from /usr/include/c++/7/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52,
                 from Ioi.cpp:2:
/usr/include/c++/7/bits/range_access.h:252:5: note:                 template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])
     size(const _Tp (&/*__array*/)[_Nm]) noexcept
     ^~~~
/usr/include/c++/7/bits/range_access.h:242:5: note:                 template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)
     size(const _Container& __cont) noexcept(noexcept(__cont.size()))
     ^~~~
Ioi.cpp:27:6: error: reference to 'size' is ambiguous
      size[a]+=size[b];
      ^~~~
Ioi.cpp:15:15: note: candidates are: int size [10010]
 int v,t[maxn],size[maxn],par[maxn];
               ^~~~
In file included from /usr/include/c++/7/string:51:0,
                 from /usr/include/c++/7/bits/locale_classes.h:40,
                 from /usr/include/c++/7/bits/ios_base.h:41,
                 from /usr/include/c++/7/ios:42,
                 from /usr/include/c++/7/istream:38,
                 from /usr/include/c++/7/sstream:38,
                 from /usr/include/c++/7/complex:45,
                 from /usr/include/c++/7/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52,
                 from Ioi.cpp:2:
/usr/include/c++/7/bits/range_access.h:252:5: note:                 template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])
     size(const _Tp (&/*__array*/)[_Nm]) noexcept
     ^~~~
/usr/include/c++/7/bits/range_access.h:242:5: note:                 template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)
     size(const _Container& __cont) noexcept(noexcept(__cont.size()))
     ^~~~
Ioi.cpp:27:15: error: reference to 'size' is ambiguous
      size[a]+=size[b];
               ^~~~
Ioi.cpp:15:15: note: candidates are: int size [10010]
 int v,t[maxn],size[maxn],par[maxn];
               ^~~~
In file included from /usr/include/c++/7/string:51:0,
                 from /usr/include/c++/7/bits/locale_classes.h:40,
                 from /usr/include/c++/7/bits/ios_base.h:41,
                 from /usr/include/c++/7/ios:42,
                 from /usr/include/c++/7/istream:38,
                 from /usr/include/c++/7/sstream:38,
                 from /usr/include/c++/7/complex:45,
                 from /usr/include/c++/7/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52,
                 from Ioi.cpp:2:
/usr/include/c++/7/bits/range_access.h:252:5: note:                 template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])
     size(const _Tp (&/*__array*/)[_Nm]) noexcept
     ^~~~
/usr/include/c++/7/bits/range_access.h:242:5: note:                 template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)
     size(const _Container& __cont) noexcept(noexcept(__cont.size()))
     ^~~~
Ioi.cpp: In function 'long long int Ioi(int, int, int*, int*, int, int, int)':
Ioi.cpp:56:11: error: reference to 'size' is ambiguous
     while(size[root]<lg){
           ^~~~
Ioi.cpp:15:15: note: candidates are: int size [10010]
 int v,t[maxn],size[maxn],par[maxn];
               ^~~~
In file included from /usr/include/c++/7/string:51:0,
                 from /usr/include/c++/7/bits/locale_classes.h:40,
                 from /usr/include/c++/7/bits/ios_base.h:41,
                 from /usr/include/c++/7/ios:42,
                 from /usr/include/c++/7/istream:38,
                 from /usr/include/c++/7/sstream:38,
                 from /usr/include/c++/7/complex:45,
                 from /usr/include/c++/7/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52,
                 from Ioi.cpp:2:
/usr/include/c++/7/bits/range_access.h:252:5: note:                 template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])
     size(const _Tp (&/*__array*/)[_Nm]) noexcept
     ^~~~
/usr/include/c++/7/bits/range_access.h:242:5: note:                 template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)
     size(const _Container& __cont) noexcept(noexcept(__cont.size()))
     ^~~~