This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "dango3.h"
#include<bits/stdc++.h>
#define ll int
#define pll pair<ll, ll>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define ld long double
using namespace std;
mt19937 rng(170306);
ll n, m;
bool check[10005];
vector <ll> a[26];
ll query(vector <ll> a)
{
vector <ll> res;
for (ll i:a) check[i]=1;
for (ll i=1; i<=n*m; i++)
if (!check[i])
res.pb(i);
for (ll i:a) check[i]=0;
return n-Query(res);
}
void Solve(ll N, ll M)
{
n=M, m=N;
for (ll i=1; i<=n*m; i++)
{
ll lo=1, hi=n;
while (hi>lo)
{
ll mid=(lo+hi)/2;
vector <ll> num; num.pb(i);
for (ll j=1; j<=mid; j++)
num.insert(num.end(), a[j].begin(), a[j].end());
if (query(num)>mid) lo=mid+1;
else hi=mid;
}
a[lo].pb(i);
}
for (ll i=1; i<=n; i++)
Answer(a[i]);
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |