Submission #939243

# Submission time Handle Problem Language Result Execution time Memory
939243 2024-03-06T07:26:56 Z Ice_man Super Dango Maker (JOI22_dango3) C++17
Compilation error
0 ms 0 KB
#include <iostream>
#include <chrono>
#include <vector>
#include <algorithm>

#define maxn 200005
#define maxlog 20
#define INF 1000000010
#define LINF 1000000000000000005
#define endl '\n'
#define pb(x) push_back(x)
#define X first
#define Y second
#define control cout<<"passed"<<endl;

#pragma GCC optimize("O3" , "Ofast" , "unroll-loops" , "fast-math")
#pragma GCC target("avx2")

using namespace std;

std::chrono::high_resolution_clock::time_point startT, currT;
constexpr double TIME_MULT = 1;

double timePassed()
{
    using namespace std::chrono;
    currT = high_resolution_clock::now();
    double time = duration_cast<duration<double>>(currT - startT).count();
    return time * TIME_MULT;
}


int n , m;

int query(vector <int> &e)
{
    vector <int> pom;

    int br[n * m + 5];
    for(int i = 0; i < n * m + 5; i++)
        br[i] = 0;

    for(int i : e)
        br[i]++;

    for(int i = 1; i <= n * m; i++)
        if(br[i] == 0)
            pom.pb(i);


    return m - Query(pom);
}



void Solve(int _n , int _m)
{
    n = _n;
    m = _m;

    vector <int> ans[n * m + 5];

    int l = 1;
    int r = m - 1;
    int in;

    for(int i = 1; i <= n * m; i++)
    {
        l = 1;
        r = m - 1;
        in = -1;

        while(l <= r)
        {
            int mid = (r - l) / 2 + l;
            ans[mid].pb(i);

            if(query(ans[mid]) > 1)
            {
                l = mid + 1;
                in = mid;
            }
            else
                r = mid - 1;

            ans[mid].pop_back();
        }
        ans[in + 1].pb(i);
    }

    for(int i = 1; i <= m; i++)
        Answer(ans[i])


}




Compilation message

dango3.cpp: In function 'int query(std::vector<int>&)':
dango3.cpp:51:16: error: 'Query' was not declared in this scope; did you mean 'query'?
   51 |     return m - Query(pom);
      |                ^~~~~
      |                query
dango3.cpp: In function 'void Solve(int, int)':
dango3.cpp:92:9: error: 'Answer' was not declared in this scope
   92 |         Answer(ans[i])
      |         ^~~~~~