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;
//int Query(vector<int> hehe);
//int Answer( vector<int> lmao );
void Solve(int N, int M) {
vector<int> one;
for( int z = 0; z < N * M; z++ ) one.push_back(z + 1);
for( int z = 0; z < M; z++ ) {
vector<int> ans;
// vector<int> one = arr;
ans.clear();
//ans.push_back(one[one.size() - 1]);
// one.pop_back();
int siz = (int)one.size();
while( (int)ans.size() != N ) {
long long lo = ( (long long)rand() * (long long)rand() ) % (long long)( siz );
int lol = (int)lo;
int bruh = one[lol];
one.erase(one.begin() + lol);
int an = Query(one);
if( an != (M - z) - 1 ) one.push_back(bruh);
else ans.push_back(bruh);
siz--;
}
Answer( ans );
}
}
/*int main() {
for( int z = 0; z < 10; z++ ) cout << rand() << " ";
} */
# | 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... |