Submission #846081

# Submission time Handle Problem Language Result Execution time Memory
846081 2023-09-07T09:26:41 Z Lib Beech Tree (IOI23_beechtree) C++17
0 / 100
1 ms 2392 KB
#include "beechtree.h"
#include <bits/stdc++.h>
using namespace std;
//vector <vector <int> > child;
int par[200003];
int color[200003];
int ok[200003];
vector<int> beechtree(int n, int m, vector<int> P, vector<int> C)
{
   //vector <int> temp;
	for(int i=0;i<=n;i++){
	//	child.push_back(temp);
	}
	for(int i=0;i<n;i++){
		par[i]=P[i];
		color[i]=C[i];
	//	child[par[i]].push_back(i-1);
	}
	ok[n-1]=1;
	ok[n-2]=1;
	for(int i=n-3;i>=0;i--){
		if(color[i]==color[i+1]){
			ok[i]=1;
			if(i==1){
				ok[0]=1;
				break;
			}
		}else{
			if(i==1){
				ok[i]=1;
			}
			break;
		}
	}
    vector<int> ans;
    for (int i = 0; i < n; ++i)
    {
        ans.push_back(ok[i]);
    }
    return ans;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 2392 KB 2nd lines differ - on the 1st token, expected: '0', found: '1'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 2392 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 2392 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 2392 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 2392 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 2392 KB 2nd lines differ - on the 1st token, expected: '0', found: '1'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 2392 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 2392 KB 2nd lines differ - on the 1st token, expected: '0', found: '1'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 2392 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 2392 KB 2nd lines differ - on the 1st token, expected: '0', found: '1'
2 Halted 0 ms 0 KB -