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>
#define ll int
#define str string
#define ins insert
#define ld long double
#define pb push_back
#define pf push_front
#define pof pop_front()
#define pob pop_back()
#define lb lower_bound
#define ub upper_bound
#define endl "\n"
#define fr first
#define sc second
#define mpa make_pair
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define sz size()
#define bc back()
#define ar array
#define vll vector<ll>
using namespace std;
template <class _T>
bool chmin(_T &x, const _T &y){
if (x>y){x=y;return true;}
return false;
}
template <class _T>
bool chmax(_T &x, const _T &y){
if (x<y){x=y;return true;}
return false;
}
const ll mod=1e9+7;
const ld eps=1e-9;
void Solve(ll n,ll m) {
ll i,j;
vector<ll> lst;
map<ll,ll> mp;
vector<vll> col(n+5);
for(i=1;i<=n;i++){
vector<ll> v=lst;
for(j=1;j<=n*m;j++){
if(mp[j])continue;
v.pb(j);
ll x=Query(v);
if(x==1){
mp[j]++;
col[i].pb(j);
lst.pb(j);
}
}
}
for(i=1;i<=m;i++){
vector<ll> v;
for(j=1;j<=n;j++){
v.pb(col[j].bc);
col[j].pop_back();
}
Answer(v);
}
}
/*
*/
# | 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... |