답안 #913830

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
913830 2024-01-20T10:18:55 Z Muhammad_Aneeq 최후의 만찬 (IOI12_supper) C++17
컴파일 오류
0 ms 0 KB
#include "grader.cpp"
#include <cmath>
#include <map>
#include <set>
#include <iostream>
void ComputeAdvice(int *C, int N, int K, int M)
{
	for (int i=0;i<N;i++)
	{
		for (int j=0;j<=log2(N);j++)
		{
			if ((1<<j)&C[i])
				WriteAdvice(1);
			else
				WriteAdvice(0);
		}
	}
}
#include "grader.h"
#include <cmath>
#include <map>
#include <set>
#include <iostream>
void Assist(unsigned char *A, int N, int K, int R)
{
	int re[N]={};
	int z=log2(N);
	map<int,int>d;
	set<int>res[N]={};
	for (int i=0;i<N;i++)
	{
		for (int j=0;j<=z;j++)
			re[i]+=(A[i*(z+1)+j]<<j);
		res[re[i]].insert(i);
		d[re[i]]++;
	}
	set<int>ind;
	for (int i=0;i<K;i++)
		ind.insert(i);
	for (int i=0;i<N;i++)
	{
		int z=GetRequest();
		d[z]--;
		res[z].erase(i); 
		if (ind.find(z)!=ind.end())
			continue;	
		int x=0;
		int f=-1;
		for (auto i:ind)
		{
			if (d[i]==0)
			{
				x=i;
				f=-1;
				break;
			}
			else
			{
				if (res[i].size()&&*begin(res[i])>f)
				{
					f=*begin(res[i]);
					x=i;
				}
			}
		}
		PutBack(x);
		ind.insert(z);
		ind.erase(x);
		res[i].erase(f);
	}
}

Compilation message

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

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