Submission #620048

# Submission time Handle Problem Language Result Execution time Memory
620048 2022-08-02T20:26:33 Z czhang2718 Super Dango Maker (JOI22_dango3) C++17
0 / 100
16 ms 468 KB
#include "dango3.h"
#include <bits/stdc++.h>
using namespace std;

void Solve(int N, int M) {
  vector<vector<int>> dango(M);
  for(int i=1; i<=N*M; i++){
    auto check=[&](int k)->bool{
      dango[k-1].push_back(i);
      int r=Query(dango[k-1]);
      dango[k-1].pop_back();
      return r==dango[k-1].size();
    };

    int j=0;
    for(int k=31-__builtin_clz(M); k>=0; k--){
      if(j+(1<<k)<M && check(j+(1<<k))) j+=(1<<k);
    }
    dango[j].push_back(i);
  }

  for(int i=0; i<M; i++) Answer(dango[i]);
}

Compilation message

dango3.cpp: In lambda function:
dango3.cpp:12:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   12 |       return r==dango[k-1].size();
      |              ~^~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 340 KB Wrong Answer [4]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 340 KB Wrong Answer [4]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 7 ms 428 KB Wrong Answer [4]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 16 ms 468 KB Wrong Answer [4]
2 Halted 0 ms 0 KB -