Submission #1147588

#TimeUsernameProblemLanguageResultExecution timeMemory
1147588ace5Super Dango Maker (JOI22_dango3)C++20
0 / 100
821 ms664 KiB
#include "dango3.h"
#include <bits/stdc++.h>

using namespace std;

void Solve(int N, int M)
{
    vector<vector<int>> ans(M);
    for(int j = 0;j < N*M;++j)
    {
        int l = 0,r = M-1;
        while(l < r)
        {
            int m = (l+r)/2;
            vector<int> que;
            for(int u = m+1;u < M;++u)
            {
                for(int j = 0;j < ans[u].size();++j)
                {
                    que.push_back(ans[u][j]+1);
                }
            }
            for(int u = j+2;u < N*M;++u)
                que.push_back(u+1);
            if(Query(que) >= M-m-1)
            {
                r = m;
            }
            else
                l = m+1;
        }
        ans[l].push_back(j+1);
    }
    for(int j = 0;j < M;++j)
    {
        Answer(ans[j]);
    }
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...