Submission #892560

# Submission time Handle Problem Language Result Execution time Memory
892560 2023-12-25T13:52:04 Z Minbaev Super Dango Maker (JOI22_dango3) C++17
Compilation error
0 ms 0 KB
#include "dango3.h"
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimize("Ofast,unroll-loops")
#define pii pair<int,int>
using namespace __gnu_pbds;
using namespace std;
#define pb push_back
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define f first
#define s second
#define pii pair<int,int>
template<class T>bool umax(T &a,T b){if(a<b){a=b;return true;}return false;}
template<class T>bool umin(T &a,T b){if(b<a){a=b;return true;}return false;}
typedef tree<int, null_type, less_equal<int>, rb_tree_tag,
	tree_order_statistics_node_update> ordered_set;
const int mod= 1e9 +7;
const int N=1e5*4;


void Solve(int n,int m){
	
	vector<int>v(n*m);
	
	for(int i = 1;i<=n*m;i++){
		v.pb(i);
	}
	
	queue<vector<int>,int>q;
	
	q.push({v,m});
	
	while(!q.empty()){
		auto [g,sz] = q.front();
		q.pop();
		if(sz==1){
			Answer(g);
			continue;
		}
		
		vector<int>vs;
		
		for(int i = 0;i<g.size();i++){
			vs.pb(g[0]);
			g.erase(g.begin());
			int x = Query(g);
			if(x<m/2){
				g.pb(vs.back());
				vs.pop_back();
			}
			
		}
		q.push({g,m/2});
		q.push({vs,(m+1)/2});
		
	}















}

























Compilation message

In file included from /usr/include/c++/10/queue:64,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:86,
                 from dango3.cpp:2:
/usr/include/c++/10/bits/stl_queue.h: In instantiation of 'class std::queue<std::vector<int>, int>':
dango3.cpp:32:24:   required from here
/usr/include/c++/10/bits/stl_queue.h:132:67: error: 'int' is not a class, struct, or union type
  132 |       static_assert(is_same<_Tp, typename _Sequence::value_type>::value,
      |                                                                   ^~~~~
/usr/include/c++/10/bits/stl_queue.h:138:47: error: 'int' is not a class, struct, or union type
  138 |       typedef typename _Sequence::value_type  value_type;
      |                                               ^~~~~~~~~~
/usr/include/c++/10/bits/stl_queue.h:139:46: error: 'int' is not a class, struct, or union type
  139 |       typedef typename _Sequence::reference  reference;
      |                                              ^~~~~~~~~
/usr/include/c++/10/bits/stl_queue.h:140:51: error: 'int' is not a class, struct, or union type
  140 |       typedef typename _Sequence::const_reference const_reference;
      |                                                   ^~~~~~~~~~~~~~~
/usr/include/c++/10/bits/stl_queue.h:141:46: error: 'int' is not a class, struct, or union type
  141 |       typedef typename _Sequence::size_type  size_type;
      |                                              ^~~~~~~~~
dango3.cpp: In function 'void Solve(int, int)':
dango3.cpp:34:4: error: 'class std::queue<std::vector<int>, int>' has no member named 'push'
   34 |  q.push({v,m});
      |    ^~~~
dango3.cpp:37:19: error: 'class std::queue<std::vector<int>, int>' has no member named 'front'
   37 |   auto [g,sz] = q.front();
      |                   ^~~~~
dango3.cpp:56:5: error: 'class std::queue<std::vector<int>, int>' has no member named 'push'
   56 |   q.push({g,m/2});
      |     ^~~~
dango3.cpp:57:5: error: 'class std::queue<std::vector<int>, int>' has no member named 'push'
   57 |   q.push({vs,(m+1)/2});
      |     ^~~~
In file included from /usr/include/c++/10/queue:64,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:86,
                 from dango3.cpp:2:
/usr/include/c++/10/bits/stl_queue.h: In instantiation of 'bool std::queue<_Tp, _Sequence>::empty() const [with _Tp = std::vector<int>; _Sequence = int]':
dango3.cpp:36:17:   required from here
/usr/include/c++/10/bits/stl_queue.h:204:18: error: request for member 'empty' in '((const std::queue<std::vector<int>, int>*)this)->std::queue<std::vector<int>, int>::c', which is of non-class type 'const int'
  204 |       { return c.empty(); }
      |                ~~^~~~~
/usr/include/c++/10/bits/stl_queue.h: In instantiation of 'void std::queue<_Tp, _Sequence>::pop() [with _Tp = std::vector<int>; _Sequence = int]':
dango3.cpp:38:9:   required from here
/usr/include/c++/10/bits/stl_queue.h:301:4: error: request for member 'pop_front' in '((std::queue<std::vector<int>, int>*)this)->std::queue<std::vector<int>, int>::c', which is of non-class type 'int'
  301 |  c.pop_front();
      |  ~~^~~~~~~~~