답안 #1081409

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1081409 2024-08-30T04:13:48 Z LCJLY 길고양이 (JOI20_stray) C++14
0 / 100
26 ms 21328 KB
#include "Anthony.h"
#include <bits/stdc++.h>
using namespace std;

//#define int long long 
//#define ld long double
#define show(x,y) cout << y << " " << #x << endl;
#define show2(x,y,i,j) cout << y << " " << #x << "  " << j << " " << #i << endl;
#define show3(x,y,i,j,p,q) cout << y << " " << #x << "  " << j << " " << #i << "  " << q << " " << #p << endl;
#define show4(x,y) for(auto it:y) cout << it << " "; cout << #x << endl;
typedef pair<int,int>pii;
typedef pair<pii,int>pi2;

vector<int>adj[200005];
int d[200005];
bool visited[200005];

void dfs(int index, int par){
	visited[index]=true;
	for(auto it:adj[index]){
		if(it==par) continue;
		if(visited[it]) continue;
		d[it]=d[index]+1;
		dfs(it,index);
	}
}

vector<int>Mark(int N, int M, int A, int B, vector<int>U, vector<int>V) {
	vector<int>ans(M);
	for(int x=0;x<M;x++){
		adj[U[x]].push_back(V[x]);
		adj[V[x]].push_back(U[x]);
	}
	
	dfs(0,-1);
	
	for(int x=0;x<M;x++){
		int hold=max(d[U[x]],d[V[x]]);
		ans[x]=hold%2;
	}
	return ans;
}
#include "Catherine.h"
#include <bits/stdc++.h>
using namespace std;

//#define int long long 
//#define ld long double
#define show(x,y) cout << y << " " << #x << endl;
#define show2(x,y,i,j) cout << y << " " << #x << "  " << j << " " << #i << endl;
#define show3(x,y,i,j,p,q) cout << y << " " << #x << "  " << j << " " << #i << "  " << q << " " << #p << endl;
#define show4(x,y) for(auto it:y) cout << it << " "; cout << #x << endl;
typedef pair<int,int>pii;
typedef pair<pii,int>pi2;

int m;
void Init(int A, int B){
	m=A;
}

int lst=-1;

int Move(vector<int>y){
	vector<int>one;
	for(int x=0;x<m;x++){
		if(y[x]==1) one.push_back(x);
	}
	sort(one.begin(),one.end());
	if(one.empty()){
		return -1;
	}
	else if(one.size()==1){
		lst=one[0];
		return one[0];
	}
	else{
		if(lst==-1){
			return 1;
		}
		else{
			return !lst;
		}
	}

}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 25 ms 21328 KB Wrong Answer [6]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 25 ms 21328 KB Wrong Answer [6]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 26 ms 19024 KB Wrong Answer [6]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 26 ms 19024 KB Wrong Answer [6]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 6436 KB Output is correct
2 Correct 2 ms 6176 KB Output is correct
3 Correct 3 ms 6236 KB Output is correct
4 Correct 2 ms 6684 KB Output is correct
5 Correct 2 ms 6692 KB Output is correct
6 Correct 3 ms 6692 KB Output is correct
7 Correct 3 ms 6684 KB Output is correct
8 Correct 3 ms 6680 KB Output is correct
9 Correct 3 ms 6676 KB Output is correct
10 Correct 3 ms 6684 KB Output is correct
11 Correct 3 ms 6692 KB Output is correct
12 Incorrect 3 ms 6688 KB Wrong Answer [6]
13 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 22 ms 16720 KB Wrong Answer [6]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 24 ms 16800 KB Output is correct
2 Incorrect 24 ms 17484 KB Wrong Answer [6]
3 Halted 0 ms 0 KB -