Submission #1023030

# Submission time Handle Problem Language Result Execution time Memory
1023030 2024-07-14T08:50:48 Z Unforgettablepl Super Dango Maker (JOI22_dango3) C++17
100 / 100
2133 ms 924 KB
#include "dango3.h"

#include <bits/stdc++.h>
using namespace std;

namespace {
}  // namespace

void Solve(int N, int M) {
	vector<vector<int>> dangos(M+1);
	for(int i=1;i<=N*M;i++){
		auto check = [&](int x){
			vector<bool> skipped(N*M+1);
			skipped[i]=true;
			for(int j=1;j<x;j++){
				for(int&k:dangos[j])skipped[k]=true;
			}
			vector<int> qu;
			for(int j=1;j<=N*M;j++)if(!skipped[j])qu.emplace_back(j);
			return Query(qu)==M-x;
		};
		int ans = 1;
		for(int jump=16;jump;jump/=2)if(jump+ans<=M and check(jump+ans))ans+=jump;
		dangos[ans].emplace_back(i);
	}
	for(int i=1;i<=M;i++)Answer(dangos[i]);
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 15 ms 348 KB Output is correct
2 Correct 11 ms 348 KB Output is correct
3 Correct 11 ms 504 KB Output is correct
4 Correct 13 ms 348 KB Output is correct
5 Correct 11 ms 348 KB Output is correct
6 Correct 11 ms 344 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 397 ms 592 KB Output is correct
2 Correct 532 ms 592 KB Output is correct
3 Correct 468 ms 592 KB Output is correct
4 Correct 502 ms 484 KB Output is correct
5 Correct 436 ms 568 KB Output is correct
6 Correct 414 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1765 ms 924 KB Output is correct
2 Correct 1726 ms 664 KB Output is correct
3 Correct 2133 ms 904 KB Output is correct
4 Correct 2003 ms 720 KB Output is correct
5 Correct 1584 ms 600 KB Output is correct
6 Correct 1585 ms 652 KB Output is correct