답안 #857395

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
857395 2023-10-06T06:21:15 Z mychecksedad 참나무 (IOI23_beechtree) C++17
0 / 100
2 ms 4956 KB
#include <beechtree.h>
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define all(x) x.begin(), x.end()
const int N = 2e5+100;


vector<array<int, 2>> g[N];
vector<int> ans;


vector<int> beechtree(int n, int m, vector<int> P, vector<int> C){
	for(int i = 1; i < n; ++i){
		g[P[i]].pb({i, C[i]});
	}
	ans.resize(n);

	bool ok = 1;
	for(int i = n - 1; i >= 0; --i){
		if(!ok) ans[i] = 0;
		else{
			if(i < n - 1 && C[i] != C[i + 1]) ok = 0, ans[i] = 0;
			else ans[i] = 1;
		}
	}

	return ans;
}	
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 4956 KB 2nd lines differ - on the 2nd token, expected: '1', found: '0'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 4956 KB 2nd lines differ - on the 1st token, expected: '1', found: '0'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 4956 KB 2nd lines differ - on the 1st token, expected: '1', found: '0'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 4956 KB 2nd lines differ - on the 2nd token, expected: '1', found: '0'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 4956 KB 2nd lines differ - on the 1st token, expected: '1', found: '0'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 4956 KB 2nd lines differ - on the 2nd token, expected: '1', found: '0'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 4956 KB 2nd lines differ - on the 1st token, expected: '1', found: '0'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 4956 KB 2nd lines differ - on the 2nd token, expected: '1', found: '0'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 4956 KB 2nd lines differ - on the 1st token, expected: '1', found: '0'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 4956 KB 2nd lines differ - on the 2nd token, expected: '1', found: '0'
2 Halted 0 ms 0 KB -