Submission #618196

# Submission time Handle Problem Language Result Execution time Memory
618196 2022-08-02T02:40:47 Z penguinhacker Super Dango Maker (JOI22_dango3) C++17
100 / 100
333 ms 524 KB
#include "dango3.h"
#include <bits/stdc++.h>
using namespace std;

mt19937 rng(42);

void Solve(int n, int m) {
	vector<bool> vis(n*m+1);
	for (int rep=0; rep<m; ++rep) {
		vector<int> v;
		for (int i=1; i<=n*m; ++i)
			if (!vis[i])
				v.push_back(i);
		while(1) {
			shuffle(v.begin(), v.end(), rng);
			int s=min((int)v.size(), 1900);
			vector<int> v2(v.begin(), v.begin()+s);
			if (Query(v2)) {
				v=v2;
				break;
			}
		}
		while(v.size()>n) {
			int x=v.back();
			v.pop_back();
			if (!Query(v))
				v.insert(v.begin(), x);
		}
		Answer(v);
		for (int i : v)
			vis[i]=1;
	}
}

Compilation message

dango3.cpp: In function 'void Solve(int, int)':
dango3.cpp:23:17: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   23 |   while(v.size()>n) {
      |         ~~~~~~~~^~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 312 KB Output is correct
2 Correct 0 ms 340 KB Output is correct
3 Correct 1 ms 308 KB Output is correct
4 Correct 0 ms 340 KB Output is correct
5 Correct 1 ms 340 KB Output is correct
6 Correct 1 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 11 ms 308 KB Output is correct
2 Correct 12 ms 340 KB Output is correct
3 Correct 12 ms 340 KB Output is correct
4 Correct 12 ms 340 KB Output is correct
5 Correct 12 ms 376 KB Output is correct
6 Correct 11 ms 312 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 212 ms 436 KB Output is correct
2 Correct 196 ms 432 KB Output is correct
3 Correct 185 ms 428 KB Output is correct
4 Correct 192 ms 432 KB Output is correct
5 Correct 195 ms 432 KB Output is correct
6 Correct 189 ms 460 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 270 ms 520 KB Output is correct
2 Correct 325 ms 524 KB Output is correct
3 Correct 266 ms 524 KB Output is correct
4 Correct 333 ms 524 KB Output is correct
5 Correct 307 ms 524 KB Output is correct
6 Correct 333 ms 524 KB Output is correct