답안 #605557

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
605557 2022-07-25T18:52:20 Z MohamedAhmed04 Super Dango Maker (JOI22_dango3) C++17
컴파일 오류
0 ms 0 KB
#include "grader.cpp"
//#include "dango3.h"
#include <bits/stdc++.h>

using namespace std ;

const int MAX = 1e4 + 10 ;

int mark[MAX] ;
int n , m ;

vector<int>ans[30] ;

vector<int>v ;

bool check(int idx , int x)
{
	v.clear() ;
	memset(mark , 0 , sizeof(mark)) ;
	mark[x] = 1 ;
	for(auto &i : ans[idx])
		mark[i] = 1 ;
	vector<int>v ;
	for(int i = 1 ; i <= n*m ; ++i)
	{
		if(!mark[i])
			v.push_back(i) ;
	}
	return (Query(v) == m-2) ;
}

void Solve(int N, int M) 
{
	n = N , m = M ;
	int cnt = 0 ;
	for(int i = 1 ; i <= n*m ; ++i)
	{
		int l = 1 , r = cnt ;
		int last = 0 ;
		while(l <= r)
		{
			int mid = (l + r) >> 1 ;
			if(check(mid , i))
				last = mid , l = mid+1 ;
			else
				r = mid-1 ;
		}
		ans[last+1].push_back(i) ;
		cnt = max(cnt , last+1) ;
	}
	for(int i = 1 ; i <= m ; ++i)
		Answer(ans[i]) ;
}

Compilation message

/usr/bin/ld: /tmp/ccyc9Pp2.o: in function `Query(std::vector<int, std::allocator<int> > const&)':
grader.cpp:(.text+0x50): multiple definition of `Query(std::vector<int, std::allocator<int> > const&)'; /tmp/ccGTF0G3.o:dango3.cpp:(.text+0x1e0): first defined here
/usr/bin/ld: /tmp/ccyc9Pp2.o: in function `Answer(std::vector<int, std::allocator<int> > const&)':
grader.cpp:(.text+0x1c0): multiple definition of `Answer(std::vector<int, std::allocator<int> > const&)'; /tmp/ccGTF0G3.o:dango3.cpp:(.text+0x210): first defined here
/usr/bin/ld: /tmp/ccyc9Pp2.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccGTF0G3.o:dango3.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status