Submission #1319609

#TimeUsernameProblemLanguageResultExecution timeMemory
1319609Sir_Ahmed_ImranSuper Dango Maker (JOI22_dango3)C++17
7 / 100
1894 ms672 KiB
#include "dango3.h"
#include <bits/stdc++.h>
using namespace std;
#define nl '\n'
#define ff first
#define ss second
#define ll long long
#define ld long double
#define terminator main
#define pll pair<ll,ll>
#define add insert
#define append push_back
#define pii pair<int,int>
#define all(x) (x).begin(),(x).end()
#define L0TA ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)

int vis[1001];
vector<int> a[25];

bool check(int n, int m, int i, int x){
    if(a[x].empty())
        return 1;
    vector<int> v;
    for(auto & j : a[x])
        vis[j] = 1;
    vis[i] = 1;
    for(int i = 1; i <= n * m; i++){
        if(vis[i]) vis[i] = 0;
        else v.append(i);
    }
    return (Query(v) == m - 1);
}

void Solve(int n, int m){
    int x;
    for(int i = 1; i <= n * m; i++){
        x = 0;
        for(int j = 16; j > 0; j /= 2)
            if(x + j < m && check(n, m, i, x + j)) 
                x += j;
        a[x].append(i);
    }
    for(int i = 0; i < m; i++)
        Answer(a[i]);
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...