# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1033163 | adaawf | Super Dango Maker (JOI22_dango3) | C++17 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
#include <vector>
//#include "dango3.h"
using namespace std;
vector<int> trya(vector<int> v, int x) {
vector<int> vv;
for (int w : v) {
if (w != x) {
vv.push_back(w);
}
}
return vv;
}
/*void Print(vector<int> v) {
for (int w : v) cout << w << " ";
cout << '\n';
}
int Query(vector<int> v) {
Print(v);
int k;
cin >> k;
return k;
}
void Answer(vector<int> v) {
Print(v);
}
void Solve(int n, int m);
int main() {
int n = 3, m = 3;
Solve(n, m);
}*/
void Solve(int n, int m) {
vector<int> v;
vector<vector<int>> res;
for (int i = 1; i <= n * m; i++) {
v.push_back(i);
}
for (int i = 1; i <= m; i++) {
vector<int> vv = v;
int h = 0;
while (vv.size() > n) {
if (h < vv.size() - 3) {
if (Query(trya(trya(trya(trya(vv, vv[h]), vv[h + 1]), vv[h + 2]), vv[h + 3])) != 0) {
vv = trya(trya(trya(trya(vv, vv[h]), vv[h + 1]), vv[h + 2]), vv[h + 3]);
}
else if (Query(trya(vv, vv[h])) != 0) {
vv = trya(vv, vv[h]);
}
else if (Query(trya(vv, vv[h + 1])) != 0) {
vv = trya(vv, vv[h + 1]);
h++;
}
else if (Query(trya(vv, vv[h + 2]))) {
vv = trya(vv, vv[h + 2]);
h += 2;
}
else if (Query(trya(vv, vv[h + 3]))) {
vv = trya(vv, vv[h + 3]);
h += 3;
}
else h += 4;
}
else if (Query(trya(vv, vv[h])) != 0) {
vv = trya(vv, vv[h]);
}
else h++;
}
res.push_back(vv);
for (int w : vv) v = trya(v, w);
}
for (auto w : res) Answer(w);
}