Submission #696104

# Submission time Handle Problem Language Result Execution time Memory
696104 2023-02-05T13:31:09 Z hpesoj Super Dango Maker (JOI22_dango3) C++17
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
#include "dango3.h"
#define pi pair <int, int>
#define ppi pair <pi, int>
#define fi first
#define se second
#define pb push_back
using namespace std;

void Solve(int N, int M) {
	vector <int> v;
	for(int i = 1; i <= n * m; i++) v.pb(i);
	vector <int> sticks[m+1];
	sticks[1].pb(1);
	for(int i = 2; i <= n * m; i++){
		int lo = 1, hi = m;
		while(lo < hi){
			int mid = (lo + hi) >> 1;
			for(int j = 0; j < sticks[mid].size(); j++) v.erase(v.find(sticks[mid][j]));
			v.erase(v.find(i));
			if(Query(v) == m-2) hi = mid;
			else lo = mid + 1;
			v.pb(i);
			for(int j = 0; j < sticks[mid].size(); j++) v.pb(sticks[mid][j]);
		}
		sticks[lo].pb(i);
	}
	for(int i = 1; i <= m; i++) Answer(sticks[i]);
}

Compilation message

dango3.cpp: In function 'void Solve(int, int)':
dango3.cpp:12:22: error: 'n' was not declared in this scope
   12 |  for(int i = 1; i <= n * m; i++) v.pb(i);
      |                      ^
dango3.cpp:12:26: error: 'm' was not declared in this scope
   12 |  for(int i = 1; i <= n * m; i++) v.pb(i);
      |                          ^
dango3.cpp:13:22: error: 'm' was not declared in this scope
   13 |  vector <int> sticks[m+1];
      |                      ^
dango3.cpp:14:2: error: 'sticks' was not declared in this scope
   14 |  sticks[1].pb(1);
      |  ^~~~~~
dango3.cpp:15:22: error: 'n' was not declared in this scope
   15 |  for(int i = 2; i <= n * m; i++){
      |                      ^
dango3.cpp:19:58: error: 'class std::vector<int>' has no member named 'find'
   19 |    for(int j = 0; j < sticks[mid].size(); j++) v.erase(v.find(sticks[mid][j]));
      |                                                          ^~~~
dango3.cpp:20:14: error: 'class std::vector<int>' has no member named 'find'
   20 |    v.erase(v.find(i));
      |              ^~~~