Submission #696113

#TimeUsernameProblemLanguageResultExecution timeMemory
696113hpesojSuper Dango Maker (JOI22_dango3)C++17
100 / 100
3750 ms672 KiB
#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> sticks[m+1];
	sticks[1].pb(1);
	bool b[n*m+1];
	for(int i = 2; i <= n * m; i++){
		int lo = 1, hi = m;
		while(lo < hi){
			int mid = (lo + hi) >> 1;
			vector <int> tmp;
			memset(b, 0, sizeof(b));
			for(int j = 0; j < sticks[mid].size(); j++) b[sticks[mid][j]] = 1;
			b[i] = 1;
			for(int j = 1; j <= n * m; j++) if(!b[j]) tmp.pb(j);
			if(Query(tmp) == m-1) hi = mid;
			else lo = mid + 1;
		}
		sticks[lo].pb(i);
	}
	for(int i = 1; i <= m; i++) Answer(sticks[i]);
}

Compilation message (stderr)

dango3.cpp: In function 'void Solve(int, int)':
dango3.cpp:22:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   22 |    for(int j = 0; j < sticks[mid].size(); j++) b[sticks[mid][j]] = 1;
      |                   ~~^~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...