# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
580852 | JustInCase | Super Dango Maker (JOI22_dango3) | C++17 | 3708 ms | 528 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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;
}
for(int32_t r = 0; r < m; r++) {
shuffle(std::begin(remDangos), std::end(remDangos), mt);
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 (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |