답안 #1095626

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1095626 2024-10-02T18:07:38 Z ThylOne 도서관 (JOI18_library) C++14
0 / 100
4 ms 600 KB
#include <cstdio>
#include <vector>
#include "library.h"
using namespace std;
int n;
int ask(vector<int> v){
	vector<int> r(n);
	fill(r.begin(),r.end(),0);
	for(int i:v)
		r[i] = 1;
	return Query(v);
}
void Solve(int N)
{
	n=N;
	vector<int> M(N);

	for(int i = 0; i < N; i++) {
		M[i] = 1;
	}
	int border = -1;
	for(int i = 0; i < n ; i++){
		M[i] = 0;
		int r = Query(M);
		if(r==1){
			//border
			border = i;
			break;
		}
		M[i] = 1;
	}
	bool in[n];
	fill(in,in+n,false);
	in[border] = true;
	vector<vector<int>> chaines;
	int tot = 1;
	while(tot<N){
		vector<int> chaine;
		vector<int> q(n);
		fill(q.begin(),q.end(),0);
		for(int i = 0;i<n;i++){
			if(!in[i]){
				q[i] = 1;
				if(Query(q)==chaine.size()+1){
					chaine.push_back(i);
					tot++;
					in[i] = true;
				}else{
					q[i] = 0;
				}
			}
		}
		chaines.push_back(chaine);
	}
	if(chaines.size()>6){
		while(true);
	}	
}

Compilation message

library.cpp: In function 'void Solve(int)':
library.cpp:44:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   44 |     if(Query(q)==chaine.size()+1){
      |        ~~~~~~~~^~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 4 ms 600 KB Wrong Answer [7]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 4 ms 600 KB Wrong Answer [7]
2 Halted 0 ms 0 KB -