# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
998439 | jampm | Super Dango Maker (JOI22_dango3) | C++17 | 567 ms | 512 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"
//Emmanuel B
//dango
#include <bits/stdc++.h>
using namespace std;
using lli=long long int;
#define pb push_back
#define deb(x) cout<<#x<<": "<<x<<endl;
#define deb2(x,y) cout<<#x<<": "<<x<<" "<<#y<<": "<<y<<endl;
void Solve(int N, int M) {
mt19937 gen;
// Seed the engine with an unsigned int
gen.seed(24234234);
// std::cout << "after seed by 1: " << gen() << '\n';
int cnt=0;
queue<int> q;
for(int i=1; i<=N*M; ++i){
q.push(i);
}
while(cnt<M){
vector<int> x;
while(x.size()<N){
if(gen()%2){
x.pb(q.front());
q.pop();
}
else{
q.push(q.front());
q.pop();
}
}
if(Query(x)){
Answer(x);
cnt++;
}
else{
for(int y:x){
q.push(y);
}
}
}
}
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... |