Submission #1091867

# Submission time Handle Problem Language Result Execution time Memory
1091867 2024-09-22T11:46:24 Z _8_8_ Super Dango Maker (JOI22_dango3) C++17
Compilation error
0 ms 0 KB
#include "dango3.h"
#include <bits/stdc++.h>
#include <vector>
using namespace std;
    
int n, m;
const int N = 401;
bool bad[N * 26];
int B = -1, timer, vis[N * 26];
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
typedef long long ll;
int qr(vector<int> &f) {
    vector<int> t;
    ++timer;
    for(int i:f) {
        vis[i] = timer;
    }
    for(int i = 1; i <= n * m; i++) {
        if(vis[i] != timer) {
            t.push_back(i);
        }
    }
    return m - Query(t);
}
vector<int> res[26];
void Solve(int _n, int _m) {
    n = _n, m = _m;
    vector<int> f, bf;
    for(int i = 1; i <= n * m; i++) {
        f.push_back(i);
    }
    shuffle(f.begin(), f.end());
    for(int i:f) {
        vector<int> o(m);
        iota(o.begin(), o.end(), 1);
        for(int j:o) {
            if((int)res[j].size() == n) continue;
            res[j].push_back(i);
            if(qr(res[j]) <= 1) {
                break;
            }
            res[j].pop_back();
        }
    }
    for(int i = 1; i <= m; i++) {
        Answer(res[i]);
    }
}

Compilation message

dango3.cpp: In function 'void Solve(int, int)':
dango3.cpp:32:31: error: no matching function for call to 'shuffle(std::vector<int>::iterator, std::vector<int>::iterator)'
   32 |     shuffle(f.begin(), f.end());
      |                               ^
In file included from /usr/include/c++/10/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from dango3.cpp:2:
/usr/include/c++/10/bits/stl_algo.h:3748:5: note: candidate: 'template<class _RAIter, class _UGenerator> void std::shuffle(_RAIter, _RAIter, _UGenerator&&)'
 3748 |     shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last,
      |     ^~~~~~~
/usr/include/c++/10/bits/stl_algo.h:3748:5: note:   template argument deduction/substitution failed:
dango3.cpp:32:31: note:   candidate expects 3 arguments, 2 provided
   32 |     shuffle(f.begin(), f.end());
      |                               ^