Submission #306159

#TimeUsernameProblemLanguageResultExecution timeMemory
306159CaroLindaStray Cat (JOI20_stray)C++14
4 / 100
426 ms524292 KiB
#include "Anthony.h"
#include <bits/stdc++.h>

#define pii pair<int,int>
#define ff first
#define ss second
#define mk make_pair
#define sz(x) (int)(x.size() )
#define ll long long
#define all(x) x.begin(),x.end()

const int MAXN = 2e5+10 ;

using namespace std ;

vector<pii> adj[MAXN] ;
vector<int> marcas ;
int seq[6] = {0,1,0,0,1,1} ;

void dfs(int x, int father , int curIdx ) //curIdx eh o que eu tenho que colocar nas minhas proximas arestas
{
	
	for(auto e : adj[x] ) 
	{
		if(e.ff == father )  continue ;

		marcas[e.ss] = seq[curIdx] ;

		if( sz(adj[e.ff] ) == 2 ) dfs( e.ff, x , (curIdx == 5 ) ? 0 : (curIdx+1) ) ;
		else dfs(e.ff, x, !seq[curIdx] ) ;
				 
	}

}

void dfs3(int x, int father, int toFill )
{

	for(auto e : adj[x] )
	{
		if(e.ff == father) continue ;

		marcas[e.ss] = toFill ;

		dfs3(e.ff, x,  (toFill == 2 ) ? 0 : (toFill+1) ) ;

	}
}

vector<int> Mark(int N, int M, int A, int B, vector<int> U, vector<int> V) 
{

	for(int i = 0 ; i < M ; i++ )
	{
		adj[ U[i] ].push_back(mk(V[i] , i ) ) ;
		adj[ V[i] ].push_back( mk(U[i],i) )  ;
	}

	marcas.resize(M, 0) ;

	if(A >= 3 ) dfs3(0,-1, 0) ;
	else 	dfs(0,-1,0) ;
	

	return marcas ;
}
#include "Catherine.h"
#include <bits/stdc++.h>

#define sz(x) (int)(x.size())
#define all(x) x.begin(),x.end()
#define ff first
#define ss second
#define pb push_back
#define mk make_pair
#define pii pair<int,int>

using namespace std ;

bool is3 = false ;
int ultimoQueVim = -1 ;

void Init(int A, int B) 
{
	if( A == 3 ) is3 = true ;
	return ;
}

int Move(vector<int> y) 
{
	int positivo = 0 ;
	for(int i = 0 ; i < sz(y) ; i++ )
		positivo += (y[i] > 0 ) ;

	if(positivo == 1 ) return max_element(all(y) ) - y.begin() ;	
	
	if( y[0] && y[1] ) return 0 ;
	if( y[0] && y[2] ) return 2; 
	if(y[1] && y[2] ) return 1 ;
}

Compilation message (stderr)

Catherine.cpp: In function 'int Move(std::vector<int>)':
Catherine.cpp:34:1: warning: control reaches end of non-void function [-Wreturn-type]
   34 | }
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...