#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;
}
}
// for(auto j : use) cout << j << " ";
// cout << endl;
// cout << "binsearch " << use[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)
......
73 | FOR(l + 1, j, use.size()) nw.pb(use[j]);
| ~~~~~~~~~~~~~
dango3.cpp:73:4: note: in expansion of macro 'FOR'
73 | 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 |
Correct |
0 ms |
340 KB |
Output is correct |
3 |
Correct |
0 ms |
340 KB |
Output is correct |
4 |
Correct |
1 ms |
340 KB |
Output is correct |
5 |
Correct |
0 ms |
340 KB |
Output is correct |
6 |
Correct |
0 ms |
340 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
15 ms |
384 KB |
Output is correct |
2 |
Correct |
15 ms |
340 KB |
Output is correct |
3 |
Correct |
23 ms |
376 KB |
Output is correct |
4 |
Correct |
25 ms |
340 KB |
Output is correct |
5 |
Correct |
13 ms |
340 KB |
Output is correct |
6 |
Correct |
11 ms |
376 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
257 ms |
468 KB |
Wrong Answer [3] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
503 ms |
600 KB |
Wrong Answer [3] |
2 |
Halted |
0 ms |
0 KB |
- |