Submission #892500

# Submission time Handle Problem Language Result Execution time Memory
892500 2023-12-25T12:34:36 Z Aiperiii Super Dango Maker (JOI22_dango3) C++17
Compilation error
0 ms 0 KB
#include "dango3.h"
#include <bits/stdc++.h>
using namespace std;
void Solve(int N,int M){
    queue < pair <vector <int> ,int>  > q;
    vector <int> in;
    vector <vector <int> > ans;
    for(int i=1;i<=n*m;i++){
        in.push_back(i);
    }
    q.push({in,m});
    while(!q.empty()){
        vector <int> v=q.front().first;
        int k=q.front().second/2;
        q.pop();
        if(k==0){
            ans.push_back(v);
            continue;
        }
        vector <int> used(v.size());
        for(int i=0;i<v.size();i++){
            used[i]=1;
            vector <int> x;
            for(int j=0;j<v.size();j++){
                if(!used[j])x.push_back(v[j]);
            }
            if(Query(x)<k)used[i]=0;
        }
        vector <int> g1,g2;
        for(int i=0;i<v.size();i++){
            if(used[i])g1.push_back(v[i]);
            else g2.push_back(v[i]);
        }
        q.push({g1,k});
        q.push({g2,k});
    }
    for(auto x : ans){
        Answer(x);
    }
}

Compilation message

dango3.cpp: In function 'void Solve(int, int)':
dango3.cpp:8:20: error: 'n' was not declared in this scope
    8 |     for(int i=1;i<=n*m;i++){
      |                    ^
dango3.cpp:8:22: error: 'm' was not declared in this scope
    8 |     for(int i=1;i<=n*m;i++){
      |                      ^
dango3.cpp:11:16: error: 'm' was not declared in this scope
   11 |     q.push({in,m});
      |                ^
dango3.cpp:11:18: error: no matching function for call to 'std::queue<std::pair<std::vector<int>, int> >::push(<brace-enclosed initializer list>)'
   11 |     q.push({in,m});
      |                  ^
In file included from /usr/include/c++/10/queue:64,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:86,
                 from dango3.cpp:2:
/usr/include/c++/10/bits/stl_queue.h:265:7: note: candidate: 'void std::queue<_Tp, _Sequence>::push(const value_type&) [with _Tp = std::pair<std::vector<int>, int>; _Sequence = std::deque<std::pair<std::vector<int>, int>, std::allocator<std::pair<std::vector<int>, int> > >; std::queue<_Tp, _Sequence>::value_type = std::pair<std::vector<int>, int>]'
  265 |       push(const value_type& __x)
      |       ^~~~
/usr/include/c++/10/bits/stl_queue.h:265:30: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const value_type&' {aka 'const std::pair<std::vector<int>, int>&'}
  265 |       push(const value_type& __x)
      |            ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/10/bits/stl_queue.h:270:7: note: candidate: 'void std::queue<_Tp, _Sequence>::push(std::queue<_Tp, _Sequence>::value_type&&) [with _Tp = std::pair<std::vector<int>, int>; _Sequence = std::deque<std::pair<std::vector<int>, int>, std::allocator<std::pair<std::vector<int>, int> > >; std::queue<_Tp, _Sequence>::value_type = std::pair<std::vector<int>, int>]'
  270 |       push(value_type&& __x)
      |       ^~~~
/usr/include/c++/10/bits/stl_queue.h:270:25: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::queue<std::pair<std::vector<int>, int> >::value_type&&' {aka 'std::pair<std::vector<int>, int>&&'}
  270 |       push(value_type&& __x)
      |            ~~~~~~~~~~~~~^~~
dango3.cpp:21:22: 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<v.size();i++){
      |                     ~^~~~~~~~~
dango3.cpp:24:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   24 |             for(int j=0;j<v.size();j++){
      |                         ~^~~~~~~~~
dango3.cpp:30:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   30 |         for(int i=0;i<v.size();i++){
      |                     ~^~~~~~~~~