Submission #857393

# Submission time Handle Problem Language Result Execution time Memory
857393 2023-10-06T06:20:38 Z mychecksedad Beech Tree (IOI23_beechtree) C++17
0 / 100
1 ms 4956 KB
// #include <beechtreee.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;
}	
# Verdict Execution time Memory 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 -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 4956 KB 2nd lines differ - on the 1st token, expected: '1', found: '0'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 4956 KB 2nd lines differ - on the 1st token, expected: '1', found: '0'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory 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 -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 4956 KB 2nd lines differ - on the 1st token, expected: '1', found: '0'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory 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 -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 4956 KB 2nd lines differ - on the 1st token, expected: '1', found: '0'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory 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 -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 4956 KB 2nd lines differ - on the 1st token, expected: '1', found: '0'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory 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 -