답안 #580850

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
580850 2022-06-22T02:07:46 Z JustInCase Super Dango Maker (JOI22_dango3) C++17
7 / 100
3181 ms 556 KB
#include "dango3.h"
#include <random>
#include <vector>
#include <algorithm>

#define solve Solve
#define	submitAnswer Answer
#define query Query

std::mt19937 mt(69);

void solve(int32_t n, int32_t m) {
	std::vector< int32_t > remDangos(n * m);
	std::vector< bool > used(n * m + 1, false);
	for(int32_t i = 1; i <= n * m; i++) {
		remDangos[i - 1] = i;
	}

	shuffle(std::begin(remDangos), std::end(remDangos), mt);

	for(int32_t r = 0; r < m; r++) {
		std::vector< int32_t > currentDangos;
		for(auto &x : remDangos) {
			std::vector< int32_t > queryDangos;
			for(int32_t i = 1; i <= n * m; i++) {
				if(!used[i] && i != x) {
					queryDangos.push_back(i);
				}
			}

			if(query(queryDangos) == m - r - 1) {
				currentDangos.push_back(x);
				used[x] = true;

				if(currentDangos.size() == n) {
					break;
				}
			}
		}

		submitAnswer(currentDangos);
		
		std::vector< int32_t > newRem;
		for(int32_t i = 1; i <= n * m; i++) {
			if(!used[i]) {
				newRem.push_back(i);
			}
		}

		remDangos = newRem;
	}
}

Compilation message

dango3.cpp: In function 'void Solve(int32_t, int32_t)':
dango3.cpp:35:29: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int32_t' {aka 'int'} [-Wsign-compare]
   35 |     if(currentDangos.size() == n) {
      |        ~~~~~~~~~~~~~~~~~~~~~^~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 340 KB Output is correct
2 Correct 0 ms 340 KB Output is correct
3 Correct 0 ms 340 KB Output is correct
4 Correct 0 ms 340 KB Output is correct
5 Correct 0 ms 340 KB Output is correct
6 Correct 0 ms 340 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 26 ms 368 KB Output is correct
2 Correct 22 ms 360 KB Output is correct
3 Correct 36 ms 340 KB Output is correct
4 Correct 34 ms 368 KB Output is correct
5 Correct 15 ms 368 KB Output is correct
6 Correct 16 ms 368 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 852 ms 436 KB Output is correct
2 Correct 952 ms 436 KB Output is correct
3 Incorrect 1822 ms 556 KB Wrong Answer [3]
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 3181 ms 524 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -