Submission #793961

# Submission time Handle Problem Language Result Execution time Memory
793961 2023-07-26T08:20:08 Z MetalPower Super Dango Maker (JOI22_dango3) C++17
100 / 100
2021 ms 612 KB
#include "dango3.h"

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

bool ans[10005];
vector<int> pos[30];

void Solve(int N, int M) {
  	for(int i = 1; i <= N * M; i++){
  		int l = 1, r = M;
  		while(l < r){
  			int mid = l + r >> 1;
  			memset(ans, 0, sizeof ans);

  			for(int j = 1; j <= mid; j++){
  				for(int x : pos[j]) ans[x] = true;
  			}
  			ans[i] = true;

  			vector<int> vec;
  			for(int i = 1; i <= N * M; i++){
  				if(!ans[i]) vec.push_back(i);
  			}

  			int curr = Query(vec);
  			if(curr >= M - mid) r = mid;
  			else l = mid + 1;
  		}
  		pos[l].push_back(i);
  	}
  	for(int i = 1; i <= M; i++) Answer(pos[i]);
}

Compilation message

dango3.cpp: In function 'void Solve(int, int)':
dango3.cpp:13:18: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   13 |      int mid = l + r >> 1;
      |                ~~^~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 300 KB Output is correct
3 Correct 1 ms 304 KB Output is correct
4 Correct 1 ms 340 KB Output is correct
5 Correct 0 ms 340 KB Output is correct
6 Correct 1 ms 300 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 15 ms 376 KB Output is correct
2 Correct 14 ms 376 KB Output is correct
3 Correct 16 ms 300 KB Output is correct
4 Correct 15 ms 384 KB Output is correct
5 Correct 15 ms 340 KB Output is correct
6 Correct 17 ms 376 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 434 ms 440 KB Output is correct
2 Correct 438 ms 464 KB Output is correct
3 Correct 507 ms 488 KB Output is correct
4 Correct 498 ms 492 KB Output is correct
5 Correct 426 ms 460 KB Output is correct
6 Correct 428 ms 460 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1779 ms 540 KB Output is correct
2 Correct 1787 ms 584 KB Output is correct
3 Correct 1980 ms 612 KB Output is correct
4 Correct 2021 ms 580 KB Output is correct
5 Correct 1719 ms 560 KB Output is correct
6 Correct 1739 ms 556 KB Output is correct