답안 #986416

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
986416 2024-05-20T13:02:53 Z Pyqe 사탕 분배 (IOI21_candies) C++17
컴파일 오류
0 ms 0 KB
#include "stations.h"
#include <bits/stdc++.h>

using namespace std;

long long nn,sq[1069];
vector<long long> al[1069];
bitset<1069> vtd;

void dfs(long long x,bool bad)
{
	long long i,sz=al[x].size(),l;
	
	vtd[x]=1;
	if(!bad)
	{
		sq[x]=nn;
		nn++;
	}
	for(i=0;i<sz;i++)
	{
		l=al[x][i];
		if(!vtd[l])
		{
			dfs(l,!bad);
		}
	}
	if(bad)
	{
		sq[x]=nn;
		nn++;
	}
}

vector<int> label(int n,int d,vector<int> ka,vector<int> la)
{
	long long i,k,l;
	vector<int> v;
	
	for(i=0;i<n;i++)
	{
		al[i].clear();
		vtd[i]=0;
	}
	for(i=0;i<n-1;i++)
	{
		k=ka[i];
		l=la[i];
		al[k].push_back(l);
		al[l].push_back(k);
	}
	nn=0;
	dfs(0,0);
	for(i=0;i<n;i++)
	{
		v.push_back(sq[i]);
	}
	return v;
}

int find_next_station(int x,int y,vector<int> a)
{
	long long i,sz=a.size();
	
	if(x>a[0])
	{
		x*=-1;
		y*=-1;
		for(i=0;i<sz;i++)
		{
			a[i]*=-1;
		}
	}
	sort(a.begin(),a.end());
	if(y<x||y>a[sz-1])
	{
		return abs(a[sz-1]);
	}
	else
	{
		return abs(*lower_bound(a.begin(),a.end(),y));
	}
}

Compilation message

candies.cpp:1:10: fatal error: stations.h: No such file or directory
    1 | #include "stations.h"
      |          ^~~~~~~~~~~~
compilation terminated.