# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
945211 | onepunchac168 | Super Dango Maker (JOI22_dango3) | C++17 | 723 ms | 1116 KiB |
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>
using namespace std;
vector <int> tmp[25];
#define pb push_back
void Solve(int n, int m) {
int dem=0;
vector <int> target;
for (int i=1;i<=n*m;i++)
{
target.push_back(i);
}
while (m>5)
{
dem++;
vector <int> need;
vector <int> needa;
for (int i=0;i<target.size();i++)
{
vector <int> cnt;
for (int j=i+1;j<target.size();j++)
{
cnt.push_back(target[j]);
}
for (auto v:need)
{
cnt.push_back(v);
}
if (Query(cnt)>=m-5)
{
needa.pb(target[i]);
}
else need.pb(target[i]);
}
for (auto v:needa)
{
tmp[dem].pb(v);
}
m-=5;
}
if (m>0)
{
dem++;
for (auto v:target)
{
tmp[dem].push_back(v);
}
}
for (int i=1;i<=dem;i++)
{
vector <int> rr=tmp[i];
int kk=rr.size()/n;
while (rr.size()>n)
{
kk--;
vector <int> need;
vector <int> needa;
for (int i=0;i<rr.size();i++)
{
vector <int> cnt;
for (int j=i+1;j<rr.size();j++)
{
cnt.push_back(rr[j]);
}
for (auto v:need)
{
cnt.push_back(v);
}
if (Query(cnt)>=kk)
{
needa.pb(rr[i]);
}
else need.pb(rr[i]);
}
Answer(needa);
swap(need,rr);
}
Answer(rr);
}
}
Compilation message (stderr)
# | 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... |