답안 #951594

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
951594 2024-03-22T07:10:39 Z pcc Super Dango Maker (JOI22_dango3) C++17
7 / 100
361 ms 2936 KB
#include "dango3.h"

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

namespace {

int variable_example = 1;
const int mxn = 1e5+10;
int col[mxn];
vector<int> done[mxn];

}  // namespace
/*
std::vector<int> x(3);
x[0] = 1;
x[1] = 2;
x[2] = 3;
variable_example = Query(x);
for (int i = 0; i < M; i++) {
std::vector<int> a(N);
for (int j = 0; j < N; j++) {
  a[j] = N * i + j + 1;
}
Answer(a);
}
*/


void Solve(int N, int M) {
	for(int i = 1;i<=N;i++){
		vector<int> v = {};
		for(int j = 1;j<i;j++){
			v.push_back(done[j][0]);
		}
		for(int j = 1;j<=N*M;j++){
			if(col[j])continue;
			v.push_back(j);
			if(v.size()<N)continue;
			if(Query(v) == 1){
				col[j] = i;
				done[i].push_back(j);
				v.pop_back();
			}
		}
	}
	for(int i = 0;i<M;i++){
		vector<int> v;
		for(int j = 1;j<=N;j++)v.push_back(done[j][i]);
		Answer(v);
	}
	return;
}

Compilation message

dango3.cpp: In function 'void Solve(int, int)':
dango3.cpp:40:15: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   40 |    if(v.size()<N)continue;
      |       ~~~~~~~~^~
dango3.cpp: At global scope:
dango3.cpp:9:5: warning: '{anonymous}::variable_example' defined but not used [-Wunused-variable]
    9 | int variable_example = 1;
      |     ^~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 2648 KB Output is correct
2 Correct 1 ms 2904 KB Output is correct
3 Correct 1 ms 2652 KB Output is correct
4 Correct 1 ms 2652 KB Output is correct
5 Correct 1 ms 2652 KB Output is correct
6 Correct 1 ms 2652 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 32 ms 2664 KB Output is correct
2 Correct 37 ms 2900 KB Output is correct
3 Correct 46 ms 2664 KB Output is correct
4 Correct 34 ms 2840 KB Output is correct
5 Correct 32 ms 2908 KB Output is correct
6 Correct 32 ms 2664 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 182 ms 2936 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 361 ms 2920 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -