이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "dango3.h"
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
vector <int> gg[35];
void Solve(int n, int m) {
for (int i=1;i<=n*m;i++)
{
int left=1;
int right=m;
int ans;
//cerr<<i<<'\n';
while (left<=right)
{
int mid=(left+right)/2;
vector <int> need;
vector <bool> kk(n*m+5,false);
for (int j=1;j<=mid;j++)
{
for (auto v:gg[j])
{
kk[v]=true;
}
}
kk[i]=true;
for (int j=1;j<=n*m;j++)
{
if (kk[j]==false)
{
need.pb(j);
}
}
//cout<<mid<<" "<<need.size()<<" "<<m-mid<<" "<<Query(need)<<'\n';
if (Query(need)>=m-mid)
{
ans=mid;
right=mid-1;
}
else left=mid+1;
}
//cout<<i<<" "<<ans<<'\n';
gg[ans].push_back(i);
}
for (int i=1;i<=m;i++)
{
Answer(gg[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... |