Submission #332930

# Submission time Handle Problem Language Result Execution time Memory
332930 2020-12-04T02:22:07 Z YJU Amusement Park (JOI17_amusement_park) C++14
Compilation error
0 ms 0 KB
#include<bits/stdc++.h>
#include "Joi.h"
#pragma GCC optimize("unroll-loops,no-stack-protector")
using namespace std;
typedef int  ll;
typedef long double ld;
typedef pair<ll,ll> pll;
const ll MOD=1e9+7;
const ll MOD2=998244353;
const ll N=4e5+5;
const ll K=350;
const ld pi=acos(-1);
const ll INF=(1LL<<60);
#define SQ(i) ((i)*(i))
#define REP(i,n) for(ll i=0;i<n;i++)
#define REP1(i,n) for(ll i=1;i<=n;i++)
#define pb push_back
#define mp make_pair
#define X first
#define Y second
#define setp setprecision
#define lwb lower_bound
#define SZ(_a) (ll)_a.size()

ll d[N],col[N],ti,tag[N];
vector<ll> lis,v[N];

ll f(ll id){return (id==d[id]?id:d[id]=f(d[id]));}

void DFS(ll nd,ll pa){
	tag[nd]=ti++;lis.pb(nd);
	for(auto i:v[nd]){
		if(i==pa)continue;
		DFS(i,nd);
	}
	lis.pb(pa);
}

void Joi(ll n,ll m,ll A[],ll B[],long long x,ll T){
	REP(i,n)d[i]=i;
	REP(i,m){
		if(f(A[i])==f(B[i]))continue
		v[A[i]].pb(B[i]);
		v[B[i]].pb(A[i]);
		d[f(A[i])]=f(B[i]);
	}
	REP(i,n)sort(v[i].begin(),v[i].end());
	DFS(0,-1);
	REP(i,n)MessageBoard(i,col[i]=(x>>(tag[i]%60))&1);
}
#include<bits/stdc++.h>
#include"Ioi.h"
#pragma GCC optimize("unroll-loops,no-stack-protector")
using namespace std;
typedef int ll;
typedef long double ld;
typedef pair<ll,ll> pll;
const ll MOD=1e9+7;
const ll MOD2=998244353;
const ll N=4e5+5;
const ll K=350;
const ld pi=acos(-1);
const ll INF=(1LL<<60);
#define SQ(i) ((i)*(i))
#define REP(i,n) for(ll i=0;i<n;i++)
#define REP1(i,n) for(ll i=1;i<=n;i++)
#define pb push_back
#define mp make_pair
#define X first
#define Y second
#define setp setprecision
#define lwb lower_bound
#define SZ(_a) (ll)_a.size()


ll d[N],col[N],ti,ans[N],tag[N];
vector<ll> lis,res,v[N];

ll f(ll id){return (id==d[id]?id:d[id]=f(d[id]));}

void DFS(ll nd,ll pa){
	tag[nd]=ti++;lis.pb(nd);
	for(auto i:v[nd]){
		if(i==pa)continue;
		DFS(i,nd);
	}
	lis.pb(pa);
}

long long Ioi(ll n,ll m,ll A[],ll B[],ll P,ll V,ll T){
	REP(i,n)d[i]=i;
	REP(i,m){
		if(f(A[i])==f(B[i]))continue
		v[A[i]].pb(B[i]);
		v[B[i]].pb(A[i]);
		d[f(A[i])]=f(B[i]);
	}
	REP(i,n)sort(v[i].begin(),v[i].end());
	DFS(0,-1);
	ans[P]=V;res.pb(P);
	//lis.resize(unique(lis.begin(),lis.end())-lis.begin());
	if(tag[P]+1>=60){
		for(int i=tag[P]-1;i>=tag[P]-120;i--){
			ans[lis[i]]=move(lis[i]);
			res.pb(lis[i]);
		}
	}else{
		for(int i=tag[P]+1;i<=tag[P]+120;i++){
			ans[lis[i]]=move(lis[i]);
			res.pb(lis[i]);
		}
	}
	long long x=0;
	for(auto i:res){
		if(ans[i])x|=(1LL<<(tag[i]%60));
	}
	return x;
}

Compilation message

Joi.cpp:13:18: warning: overflow in conversion from 'long long int' to 'll' {aka 'int'} changes value from '1152921504606846976' to '0' [-Woverflow]
   13 | const ll INF=(1LL<<60);
      |              ~~~~^~~~~
Joi.cpp: In function 'void Joi(ll, ll, ll*, ll*, long long int, ll)':
Joi.cpp:42:31: error: expected ';' before 'v'
   42 |   if(f(A[i])==f(B[i]))continue
      |                               ^
      |                               ;
   43 |   v[A[i]].pb(B[i]);
      |   ~                            

Ioi.cpp:13:18: warning: overflow in conversion from 'long long int' to 'll' {aka 'int'} changes value from '1152921504606846976' to '0' [-Woverflow]
   13 | const ll INF=(1LL<<60);
      |              ~~~~^~~~~
Ioi.cpp: In function 'long long int Ioi(ll, ll, ll*, ll*, ll, ll, ll)':
Ioi.cpp:43:31: error: expected ';' before 'v'
   43 |   if(f(A[i])==f(B[i]))continue
      |                               ^
      |                               ;
   44 |   v[A[i]].pb(B[i]);
      |   ~