QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#219023#7123. Robot ContestPyqe#Compile Error//C++141.1kb2023-10-18 22:13:192024-04-21 00:26:42

Judging History

你现在查看的是测评时间为 2024-04-21 00:26:42 的历史记录

  • [2024-04-28 07:55:03]
  • 管理员手动重测本题所有提交记录
  • [2024-04-21 00:26:42]
  • 管理员手动重测本题所有提交记录
  • [2023-10-18 22:13:19]
  • 评测
  • [2023-10-18 22:13:19]
  • 提交

answer

#include <bits/stdc++.h>
#include "beechtree.h"

using namespace std;

long long n,m,nn,pr[200069],a[200069];
vector<long long> al[200069];
array<long long,9> dp[200069],as[200069];
bool bad;

void dfs(long long x)
{
	long long i,j,sz=al[x].size(),l;
	
	for(i=1;i<=m;i++)
	{
		dp[x][i]=0;
	}
	for(i=0;i<sz;i++)
	{
		l=al[x][i];
		dfs(l);
		if(dp[x][a[l]])
		{
			bad=1;
		}
		dp[x][a[l]]=dp[l][a[l]]+1;
	}
	for(i=0;i<sz;i++)
	{
		l=al[x][i];
		for(j=1;j<=m;j++)
		{
			if(dp[l][a[l]]&&!dp[x][a[l]])
			{
				bad=1;
			}
		}
	}
	nn++;
	as[nn]=dp[x];
}

inline bool slv(long long x)
{
	long long i,j;
	
	nn=0;
	bad=0;
	dfs(x);
	if(bad)
	{
		return 0;
	}
	sort(as+1,as+nn+1);
	for(i=1;i<=nn-1;i++)
	{
		for(j=1;j<=m;j++)
		{
			if(as[i][j]>as[i+1][j])
			{
				return 0;
			}
		}
	}
	return 1;
}

vector<int> beechtree(int on,int om,vector<int> opr,vector<int> oa)
{
	long long i;
	vector<int> sq;
	
	n=on;
	m=om;
	for(i=1;i<=n;i++)
	{
		pr[i]=opr[i-1]+1;
		a[i]=oa[i-1];
		al[pr[i]].push_back(i);
	}
	for(i=1;i<=n;i++)
	{
		sq.push_back(slv(i));
	}
	return sq;
}

詳細信息

answer.code:2:10: fatal error: beechtree.h: No such file or directory
    2 | #include "beechtree.h"
      |          ^~~~~~~~~~~~~
compilation terminated.