#include "dango3.h"
//
#include <bits/stdc++.h>
#define ll long long
#define f first
#define s second
#define pb push_back
#define mp make_pair
#define o cout<<"BUG"<<endl;
#define FOR(i, j, n) for(int j = i; j < n; ++j)
#define forn(i, j, n) for(int j = i; j <= n; ++j)
#define nfor(i, j, n) for(int j = n; j >= i; --j)
#define sortv(vv) sort(vv.begin(), vv.end())
#define all(v) v.begin(), v.end()
#define ld long double
#define ull unsigned long long
using namespace std;
const int maxn=1e6+100,LOG=17, mod=1e9+7;
int block = 320, timer = 0;
const ld EPS = 1e-18;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define bt(i) (1 << (i))
//#define int ll
const int inf=1e9+10;
#define y1 yy
#define prev pre
#define pii pair <int, int>
void Solve(int n, int m)
{
vector <int> use;
forn(1, i, n*m)
{
use.pb(i);
}
forn(1, iter, m)
{
vector <int> que, fin;
forn(1, i, n)
{
int l = 0;
int r = use.size();
while(r - l > 1)
{
int mid = (l + r) / 2;
que.clear();
FOR(0, j, mid)
{
que.pb(use[j]);
}
for(auto j : fin) que.pb(j);
if(Query(que) == 1)
{
r = mid;
}
else
{
l = mid;
}
}
// cout << "binsearch " << l << endl;
fin.pb(use[l]);
vector <int> nw;
FOR(0, j, l) nw.pb(use[j]);
FOR(l + 1, j, use.size()) nw.pb(use[j]);
use = nw;
}
// cout << "ANSWER ";
// for(auto i : fin) cout << i << " ";
// cout << endl;
Answer(fin);
}
}
Compilation message
dango3.cpp: In function 'void Solve(int, int)':
dango3.cpp:12:39: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
12 | #define FOR(i, j, n) for(int j = i; j < n; ++j)
......
71 | FOR(l + 1, j, use.size()) nw.pb(use[j]);
| ~~~~~~~~~~~~~
dango3.cpp:71:4: note: in expansion of macro 'FOR'
71 | FOR(l + 1, j, use.size()) nw.pb(use[j]);
| ^~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
340 KB |
Output is correct |
2 |
Incorrect |
0 ms |
340 KB |
Wrong Answer [7] |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
9 ms |
340 KB |
Wrong Answer [7] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
102 ms |
480 KB |
Wrong Answer [7] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
391 ms |
604 KB |
Wrong Answer [7] |
2 |
Halted |
0 ms |
0 KB |
- |