# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
998429 | efishel | Super Dango Maker (JOI22_dango3) | C++17 | 251 ms | 604 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.
//Logan/Dango
#include "dango3.h"
#include <bits/stdc++.h>
using namespace std;
void Solve(int N, int M){
srand(94894571);
int used[N*M+1],dis=N*M;
vector<int>r,rs[M];
for(int i=1;i<=N*M;i++)used[i]=0;
for(int i=1;i<=M;i++){
while(r.size()<N||!Query(r)){
int j=1,k=rand()%dis;
while(true){
if(used[j])j++;
else if(k)j++,k--;
else break;
}
r.push_back(j);
used[j]=1,dis--;
}
while(N<r.size()){
int t=r[0];
r.erase(r.begin());
if(!Query(r))r.push_back(t);
else used[t]=0,dis++;
}
Answer(r);
r.clear();
}
}
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... |