답안 #306159

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
306159 2020-09-24T17:36:59 Z CaroLinda 길고양이 (JOI20_stray) C++14
4 / 100
426 ms 524292 KB
#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

Catherine.cpp: In function 'int Move(std::vector<int>)':
Catherine.cpp:34:1: warning: control reaches end of non-void function [-Wreturn-type]
   34 | }
      | ^
# 결과 실행 시간 메모리 Grader output
1 Correct 56 ms 21024 KB Output is correct
2 Correct 4 ms 9984 KB Output is correct
3 Correct 46 ms 19568 KB Output is correct
4 Correct 72 ms 22800 KB Output is correct
5 Correct 71 ms 22796 KB Output is correct
6 Correct 55 ms 20504 KB Output is correct
7 Correct 53 ms 20356 KB Output is correct
8 Correct 67 ms 21824 KB Output is correct
9 Correct 64 ms 21580 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 56 ms 21024 KB Output is correct
2 Correct 4 ms 9984 KB Output is correct
3 Correct 46 ms 19568 KB Output is correct
4 Correct 72 ms 22800 KB Output is correct
5 Correct 71 ms 22796 KB Output is correct
6 Correct 55 ms 20504 KB Output is correct
7 Correct 53 ms 20356 KB Output is correct
8 Correct 67 ms 21824 KB Output is correct
9 Correct 64 ms 21580 KB Output is correct
10 Runtime error 349 ms 524292 KB Execution killed with signal 9 (could be triggered by violating memory limits)
11 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 52 ms 18592 KB Output is correct
2 Correct 4 ms 9984 KB Output is correct
3 Correct 46 ms 17464 KB Output is correct
4 Correct 67 ms 20492 KB Output is correct
5 Correct 66 ms 20476 KB Output is correct
6 Correct 52 ms 18180 KB Output is correct
7 Correct 52 ms 18176 KB Output is correct
8 Correct 63 ms 19460 KB Output is correct
9 Correct 62 ms 19412 KB Output is correct
10 Correct 56 ms 19308 KB Output is correct
11 Correct 57 ms 19200 KB Output is correct
12 Correct 60 ms 19028 KB Output is correct
13 Correct 57 ms 19204 KB Output is correct
14 Correct 62 ms 19468 KB Output is correct
15 Correct 62 ms 19296 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 52 ms 18592 KB Output is correct
2 Correct 4 ms 9984 KB Output is correct
3 Correct 46 ms 17464 KB Output is correct
4 Correct 67 ms 20492 KB Output is correct
5 Correct 66 ms 20476 KB Output is correct
6 Correct 52 ms 18180 KB Output is correct
7 Correct 52 ms 18176 KB Output is correct
8 Correct 63 ms 19460 KB Output is correct
9 Correct 62 ms 19412 KB Output is correct
10 Correct 56 ms 19308 KB Output is correct
11 Correct 57 ms 19200 KB Output is correct
12 Correct 60 ms 19028 KB Output is correct
13 Correct 57 ms 19204 KB Output is correct
14 Correct 62 ms 19468 KB Output is correct
15 Correct 62 ms 19296 KB Output is correct
16 Runtime error 426 ms 524292 KB Execution killed with signal 9 (could be triggered by violating memory limits)
17 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 5 ms 9984 KB Wrong Answer [5]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 46 ms 16100 KB Wrong Answer [5]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 45 ms 16080 KB Wrong Answer [5]
2 Halted 0 ms 0 KB -