#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 |
1 |
Correct |
0 ms |
452 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
344 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
1 ms |
348 KB |
Output is correct |
6 |
Correct |
1 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
11 ms |
348 KB |
Output is correct |
2 |
Correct |
11 ms |
444 KB |
Output is correct |
3 |
Correct |
11 ms |
348 KB |
Output is correct |
4 |
Correct |
11 ms |
516 KB |
Output is correct |
5 |
Correct |
11 ms |
348 KB |
Output is correct |
6 |
Correct |
11 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
312 ms |
580 KB |
Output is correct |
2 |
Correct |
335 ms |
344 KB |
Output is correct |
3 |
Correct |
348 ms |
596 KB |
Output is correct |
4 |
Correct |
380 ms |
580 KB |
Output is correct |
5 |
Correct |
319 ms |
348 KB |
Output is correct |
6 |
Correct |
321 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1411 ms |
704 KB |
Output is correct |
2 |
Correct |
1413 ms |
704 KB |
Output is correct |
3 |
Correct |
1530 ms |
852 KB |
Output is correct |
4 |
Correct |
1413 ms |
972 KB |
Output is correct |
5 |
Correct |
1264 ms |
672 KB |
Output is correct |
6 |
Correct |
1309 ms |
852 KB |
Output is correct |