답안 #892651

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
892651 2023-12-25T16:12:17 Z iskhakkutbilim Super Dango Maker (JOI22_dango3) C++17
2 / 100
397 ms 676 KB
#include "dango3.h"
#include <bits/stdc++.h>
using namespace std;



void Solve(int n, int m){
	vector<int> used(n * m + 1, 0);
	vector<vector<int> > ans(n);
	vector<int> asking;
	for(int i = 0;i < n; i++){
		vector<int> idx = asking;
		for(int j = 1;j <= n * m; j++){
			if(used[j]) continue;
			idx.push_back(j);
			int cnt = Query(idx);
			if(cnt == 1){
				ans[i].push_back(j);
				used[j] = 1;
				idx.pop_back();
			}
		}
		for(int el : ans[i]){
			asking.push_back(el);
		}
		
	}
	vector<vector<int> > vec(m);
	for(int i = 0;i < n; i++){
		int cur = 0;
		if(ans[i].size() != m) assert(false);
		for(int j : ans[i]){
			vec[cur++].push_back(j);
		}
	}
	for(int i = 0;i < m; i++) Answer(vec[i]);
}

Compilation message

dango3.cpp: In function 'void Solve(int, int)':
dango3.cpp:31:20: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   31 |   if(ans[i].size() != m) assert(false);
      |      ~~~~~~~~~~~~~~^~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 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 0 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 53 ms 348 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 189 ms 580 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 397 ms 676 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -