Submission #954312

# Submission time Handle Problem Language Result Execution time Memory
954312 2024-03-27T15:39:10 Z LCJLY Super Dango Maker (JOI22_dango3) C++17
Compilation error
0 ms 0 KB
#include "dango3.h"
#include <bits/stdc++.h>

//code
#define show(x,y) cout << y << " " << #x << endl;
#define show2(x,y,i,j) cout << y << " " << #x << "  " << j << " " << #i << endl;
#define show3(x,y,i,j,p,q) cout << y << " " << #x << "  " << j << " " << #i << "  " << q << " " << #p << endl;
#define show4(x,y) for(auto it:y) cout << it << " "; cout << #x << endl;
typedef pair<int,int>pii;
typedef pair<pii,pii>pi2;

//Query()  Answer()

void Solve(int n, int m) {
	vector<int>arr[m];
	arr[0].push_back(1);
	
	vector<int>v;
	for(int x=n*m;x>=2;x--){
		v.push_back(x);
	}
	
	for(int x=2;x<=n*m;x++){
		unordered_set<int>se;
		for(int y=0;y<m;y++){
			for(auto it:arr[y]) se.insert(it);
			vector<int>que;
			for(int i=1;i<=n*m;i++){
				if(i==x) continue;
				if(se.find(i)!=se.end()) continue;
				que.push_back(i);
			}
			
			int hold=Query(que);
			if(hold==m-y-1){
				arr[y].push_back(x);
				break;
			}
		}
	}
	
	for(int x=0;x<m;x++){
		Answer(arr[x]);
	}
}
//code

Compilation message

dango3.cpp:9:9: error: 'pair' does not name a type
    9 | typedef pair<int,int>pii;
      |         ^~~~
dango3.cpp:10:9: error: 'pair' does not name a type
   10 | typedef pair<pii,pii>pi2;
      |         ^~~~
dango3.cpp: In function 'void Solve(int, int)':
dango3.cpp:15:2: error: 'vector' was not declared in this scope
   15 |  vector<int>arr[m];
      |  ^~~~~~
dango3.cpp:15:2: note: suggested alternatives:
In file included from /usr/include/c++/10/vector:67,
                 from dango3.h:1,
                 from dango3.cpp:1:
/usr/include/c++/10/bits/stl_vector.h:389:11: note:   'std::vector'
  389 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
In file included from dango3.h:1,
                 from dango3.cpp:1:
/usr/include/c++/10/vector:86:13: note:   'std::pmr::vector'
   86 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
dango3.cpp:15:9: error: expected primary-expression before 'int'
   15 |  vector<int>arr[m];
      |         ^~~
dango3.cpp:16:2: error: 'arr' was not declared in this scope
   16 |  arr[0].push_back(1);
      |  ^~~
dango3.cpp:18:9: error: expected primary-expression before 'int'
   18 |  vector<int>v;
      |         ^~~
dango3.cpp:20:3: error: 'v' was not declared in this scope
   20 |   v.push_back(x);
      |   ^
dango3.cpp:24:3: error: 'unordered_set' was not declared in this scope
   24 |   unordered_set<int>se;
      |   ^~~~~~~~~~~~~
dango3.cpp:24:3: note: suggested alternatives:
In file included from /usr/include/c++/10/unordered_set:47,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:118,
                 from dango3.cpp:2:
/usr/include/c++/10/bits/unordered_set.h:97:11: note:   'std::unordered_set'
   97 |     class unordered_set
      |           ^~~~~~~~~~~~~
In file included from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:118,
                 from dango3.cpp:2:
/usr/include/c++/10/unordered_set:64:13: note:   'std::pmr::unordered_set'
   64 |       using unordered_set
      |             ^~~~~~~~~~~~~
dango3.cpp:24:17: error: expected primary-expression before 'int'
   24 |   unordered_set<int>se;
      |                 ^~~
dango3.cpp:26:24: error: 'se' was not declared in this scope
   26 |    for(auto it:arr[y]) se.insert(it);
      |                        ^~
dango3.cpp:27:11: error: expected primary-expression before 'int'
   27 |    vector<int>que;
      |           ^~~
dango3.cpp:30:8: error: 'se' was not declared in this scope
   30 |     if(se.find(i)!=se.end()) continue;
      |        ^~
dango3.cpp:31:5: error: 'que' was not declared in this scope
   31 |     que.push_back(i);
      |     ^~~
dango3.cpp:34:19: error: 'que' was not declared in this scope
   34 |    int hold=Query(que);
      |                   ^~~