# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
580852 | 2022-06-22T02:08:50 Z | JustInCase | Super Dango Maker (JOI22_dango3) | C++17 | 3708 ms | 528 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; } 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
# | Verdict | Execution time | Memory | 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 |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 22 ms | 364 KB | Output is correct |
2 | Correct | 24 ms | 368 KB | Output is correct |
3 | Correct | 22 ms | 340 KB | Output is correct |
4 | Correct | 22 ms | 340 KB | Output is correct |
5 | Correct | 25 ms | 364 KB | Output is correct |
6 | Correct | 26 ms | 344 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 800 ms | 428 KB | Output is correct |
2 | Correct | 749 ms | 448 KB | Output is correct |
3 | Correct | 714 ms | 440 KB | Output is correct |
4 | Correct | 751 ms | 432 KB | Output is correct |
5 | Correct | 729 ms | 448 KB | Output is correct |
6 | Correct | 764 ms | 468 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 3443 ms | 516 KB | Output is correct |
2 | Correct | 3708 ms | 468 KB | Output is correct |
3 | Correct | 3481 ms | 524 KB | Output is correct |
4 | Correct | 3524 ms | 520 KB | Output is correct |
5 | Correct | 3681 ms | 528 KB | Output is correct |
6 | Correct | 3449 ms | 528 KB | Output is correct |