Submission #846069

# Submission time Handle Problem Language Result Execution time Memory
846069 2023-09-07T09:06:36 Z Lib Beech Tree (IOI23_beechtree) C++17
0 / 100
1 ms 2396 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=1;i<=n;i++){
		par[i]=P[i-1];
		color[i]=C[i-1];
	//	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;
		}else{
			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 2nd token, expected: '1', found: '0'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 2396 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 2396 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 0 ms 2396 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 2396 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 2396 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 2396 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 -