답안 #939246

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
939246 2024-03-06T07:27:49 Z Ice_man Super Dango Maker (JOI22_dango3) C++17
0 / 100
1685 ms 1012 KB
#include <iostream>
#include <chrono>
#include <vector>
#include <algorithm>
#include "dango3.h"

#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;

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]);


}




# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 348 KB Wrong Answer [4]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 17 ms 348 KB Wrong Answer [4]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 441 ms 1012 KB Wrong Answer [4]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1685 ms 992 KB Wrong Answer [4]
2 Halted 0 ms 0 KB -