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>
#pragma GCC optimize("O3,unroll-loops")
#define pb push_back
#define F first
#define S second
#define all(a) a.begin(),a.end()
#define pii pair <ll,ll>
#define PII pair<pii , pii>
#define ld long double
#define ll long long
#define sz(v) (int)v.size()
#define rep(i , a , b) for(int i=a;i <= b;i++)
#define per(i , a , b) for(int i=a;i >= b;i--)
using namespace std ;
const int maxn = 6e5 + 10 , N = 1e5 +1 , lg = 20 , maxq = 202 , inf = 1e9 , maxk = 2022 , mod =998244353;
vector <int> vec;
int mark[maxn] ;
void sl(vector <int> vec , int m){
if(m == 1){
Answer(vec);
return ;
}
int x= m/2 ;
rep(i , 0, sz(vec))mark[i] =0 ;
rep(i , 0 ,sz(vec)-1){
mark[vec[i]] = 1;
}
rep(i , 0 , sz(vec)-1){
mark[i] =0 ;
vector <int> d ;
rep(i , 0,sz(vec)-1){
if(mark[i] == 1)d.pb(vec[i]);
}
if(Query(d) < x){
mark[i] = 1;
}
}
vector <int> v1 , v2 ;
rep(i ,0 ,sz(vec)-1){
if(mark[i] == 1)v1.pb(vec[i]);
else v2.pb(vec[i]) ;
}
sl(v1 , x);
sl(v2 , m-x) ;
}
void Solve(int n, int m) {
rep(i ,1 , n*m)vec.pb(i);
sl(vec , m);
}
# | 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... |