Submission #697490

# Submission time Handle Problem Language Result Execution time Memory
697490 2023-02-10T05:38:37 Z ld_minh4354 Super Dango Maker (JOI22_dango3) C++17
Compilation error
0 ms 0 KB
#include "dango3.h"
#include<bits/stdc++.h>
using namespace std;

void Solve(int n, int m)
{
	int i,cur_n,a[10005],num_taken,id,query_ans;
	bool taken[10005];
	set<int> s;
	
	for (i=1;i<n*m+1;i++) s.insert(i);
	
	for (int w=1;w<m;w++)
	{
		vector<int> ans;
		
		cur_n=0;
		for (auto u:s)
		{
			cur_n++;
			a[cur_n]=u;
		}
		shuffle(a+1,a+cur_n+1,rng);
		
	//	for (i=1;i<cur_n+1;i++) cout<<a[i]<<" ";
	//	cout<<"\n";
		
		for (i=1;i<cur_n+1;i++) taken[i]=false;
		taken[1]=true;
		ans.pb(a[1]);
		s.erase(a[1]);
		num_taken=1;
		
		id=1;
		while (num_taken<n)
		{
			id++;
			vector<int> query_v;
			for (i=1;i<cur_n+1;i++) if (!taken[i] and i!=id) query_v.pb(a[i]);
			
			query_ans=Query(query_v);
			
			if (query_ans==m-w)
			{
				taken[id]=true;
				ans.pb(a[id]);
				num_taken++;
				s.erase(a[id]);
			}
		}
		
//		for (auto u:ans) cout<<u<<" ";
//		cout<<"\n";
		
		Answer(ans);
	}
	
	vector<int> final_ans;
	for (auto u:s) final_ans.pb(u);
	Answer(final_ans);
}

Compilation message

dango3.cpp: In function 'void Solve(int, int)':
dango3.cpp:23:25: error: 'rng' was not declared in this scope
   23 |   shuffle(a+1,a+cur_n+1,rng);
      |                         ^~~
dango3.cpp:30:7: error: 'class std::vector<int>' has no member named 'pb'
   30 |   ans.pb(a[1]);
      |       ^~
dango3.cpp:39:61: error: 'class std::vector<int>' has no member named 'pb'
   39 |    for (i=1;i<cur_n+1;i++) if (!taken[i] and i!=id) query_v.pb(a[i]);
      |                                                             ^~
dango3.cpp:46:9: error: 'class std::vector<int>' has no member named 'pb'
   46 |     ans.pb(a[id]);
      |         ^~
dango3.cpp:59:27: error: 'class std::vector<int>' has no member named 'pb'
   59 |  for (auto u:s) final_ans.pb(u);
      |                           ^~