Submission #1037257

# Submission time Handle Problem Language Result Execution time Memory
1037257 2024-07-28T11:43:25 Z juicy Super Dango Maker (JOI22_dango3) C++17
100 / 100
672 ms 996 KB
#include <bits/stdc++.h>

#include "dango3.h"

using namespace std;

#ifdef LOCAL
#include "debug.h"
#else
#define debug(...) 42
#endif

void dc(vector<int> cands, int lay) {
  if (lay == 1) {
    Answer(cands);
    return;
  }
  int md = lay / 2;
  vector<bool> vs(cands.size());
  vector<int> lt, rt;
  for (int i = 0; i < cands.size(); ++i) {
    vector<int> nw;
    for (int j = 0; j < cands.size(); ++j) {
      if (!vs[j] && i != j) {
        nw.push_back(cands[j]);
      }
    }
    if (Query(nw) >= md) {
      vs[i] = 1;
      rt.push_back(cands[i]);
    } else {
      lt.push_back(cands[i]);
    }
  }
  dc(lt, md);
  dc(rt, lay - md);
}

void Solve(int N, int M) {
  vector<int> res(N * M);
  iota(res.begin(), res.end(), 1);
  dc(res, M);
}

Compilation message

dango3.cpp: In function 'void dc(std::vector<int>, int)':
dango3.cpp:21:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   21 |   for (int i = 0; i < cands.size(); ++i) {
      |                   ~~^~~~~~~~~~~~~~
dango3.cpp:23:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   23 |     for (int j = 0; j < cands.size(); ++j) {
      |                     ~~^~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 344 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 344 KB Output is correct
2 Correct 5 ms 444 KB Output is correct
3 Correct 6 ms 348 KB Output is correct
4 Correct 6 ms 344 KB Output is correct
5 Correct 6 ms 348 KB Output is correct
6 Correct 5 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 142 ms 604 KB Output is correct
2 Correct 141 ms 600 KB Output is correct
3 Correct 144 ms 600 KB Output is correct
4 Correct 152 ms 600 KB Output is correct
5 Correct 154 ms 616 KB Output is correct
6 Correct 132 ms 600 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 536 ms 712 KB Output is correct
2 Correct 545 ms 760 KB Output is correct
3 Correct 672 ms 760 KB Output is correct
4 Correct 646 ms 600 KB Output is correct
5 Correct 592 ms 996 KB Output is correct
6 Correct 583 ms 748 KB Output is correct