#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[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 |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
348 KB |
Output is correct |
2 |
Correct |
5 ms |
348 KB |
Output is correct |
3 |
Correct |
6 ms |
348 KB |
Output is correct |
4 |
Correct |
6 ms |
348 KB |
Output is correct |
5 |
Correct |
5 ms |
348 KB |
Output is correct |
6 |
Correct |
5 ms |
528 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
123 ms |
664 KB |
Output is correct |
2 |
Correct |
118 ms |
604 KB |
Output is correct |
3 |
Correct |
135 ms |
600 KB |
Output is correct |
4 |
Correct |
133 ms |
600 KB |
Output is correct |
5 |
Correct |
112 ms |
664 KB |
Output is correct |
6 |
Correct |
108 ms |
652 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
431 ms |
1092 KB |
Output is correct |
2 |
Correct |
431 ms |
844 KB |
Output is correct |
3 |
Correct |
532 ms |
788 KB |
Output is correct |
4 |
Correct |
559 ms |
1040 KB |
Output is correct |
5 |
Correct |
412 ms |
604 KB |
Output is correct |
6 |
Correct |
435 ms |
848 KB |
Output is correct |