답안 #748522

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
748522 2023-05-26T12:27:02 Z AdamGS Super Dango Maker (JOI22_dango3) C++17
100 / 100
3449 ms 920 KB
#include "dango3.h"
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define rep(a, b) for(int a = 0; a < (b); ++a)
#define st first
#define nd second
#define pb push_back
#define all(a) a.begin(), a.end()
void Solve(int n, int m) {
	vector<vector<int>>V;
	rep(i, n*m) {
		int po=0, ko=V.size();
		while(po<ko) {
			int sr=(po+ko)/2;
			vector<int>czy(n*m, 1);
			rep(j, sr+1) if(j!=V.size()) for(auto l : V[j]) czy[l]=0;
			czy[i]=0;
			vector<int>P;
			rep(j, n*m) if(czy[j]) P.pb(j+1);
			if(Query(P)==m-sr-1) ko=sr; else po=sr+1;
		}
		if(po==V.size()) V.pb({i}); else V[po].pb(i);
	}
	for(auto i : V) {
		vector<int>A=i;
		rep(j, A.size()) ++A[j];
		Answer(A);
	}
}

Compilation message

dango3.cpp: In function 'void Solve(int, int)':
dango3.cpp:18:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::vector<int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   18 |    rep(j, sr+1) if(j!=V.size()) for(auto l : V[j]) czy[l]=0;
      |                    ~^~~~~~~~~~
dango3.cpp:24:8: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::vector<int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   24 |   if(po==V.size()) V.pb({i}); else V[po].pb(i);
      |      ~~^~~~~~~~~~
dango3.cpp:6:36: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    6 | #define rep(a, b) for(int a = 0; a < (b); ++a)
      |                                    ^
dango3.cpp:28:3: note: in expansion of macro 'rep'
   28 |   rep(j, A.size()) ++A[j];
      |   ^~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 1 ms 340 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 304 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 22 ms 368 KB Output is correct
2 Correct 17 ms 376 KB Output is correct
3 Correct 28 ms 368 KB Output is correct
4 Correct 28 ms 340 KB Output is correct
5 Correct 17 ms 340 KB Output is correct
6 Correct 18 ms 368 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 659 ms 588 KB Output is correct
2 Correct 654 ms 476 KB Output is correct
3 Correct 856 ms 596 KB Output is correct
4 Correct 859 ms 600 KB Output is correct
5 Correct 548 ms 468 KB Output is correct
6 Correct 531 ms 468 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2655 ms 588 KB Output is correct
2 Correct 2577 ms 584 KB Output is correct
3 Correct 3439 ms 880 KB Output is correct
4 Correct 3449 ms 920 KB Output is correct
5 Correct 2134 ms 592 KB Output is correct
6 Correct 2091 ms 716 KB Output is correct