#include "dango3.h"
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)(n); i ++)
#define rep1(i, n) for(int i = 1; i <= (int)(n); i ++)
#define MP make_pair
using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
int n, m;
vector<int> ans[25];
int ask(vector<int> v)
{
set<int> st;
for (int i : v) st.insert(i);
vector<int> vec;
rep1(i, n * m) if (st.find(i) == st.end()) vec.push_back(i);
return Query(vec);
}
void Solve(int n, int m)
{
::n = n, ::m = m;
rep1(i, n * m) {
int l = 0, r = m - 1;
while (l < r) {
int mid = (l + r) / 2;
vector<int> vec = ans[mid];
vec.push_back(i);
if (ask(vec) == m - 1) r = mid; else l = mid + 1;
}
ans[l].push_back(i);
}
rep(i, m) Answer(ans[i]);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
360 KB |
Output is correct |
2 |
Correct |
1 ms |
340 KB |
Output is correct |
3 |
Correct |
1 ms |
340 KB |
Output is correct |
4 |
Correct |
1 ms |
340 KB |
Output is correct |
5 |
Correct |
1 ms |
340 KB |
Output is correct |
6 |
Correct |
1 ms |
340 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
68 ms |
380 KB |
Output is correct |
2 |
Correct |
70 ms |
520 KB |
Output is correct |
3 |
Correct |
78 ms |
372 KB |
Output is correct |
4 |
Correct |
69 ms |
380 KB |
Output is correct |
5 |
Correct |
61 ms |
392 KB |
Output is correct |
6 |
Correct |
59 ms |
396 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2117 ms |
628 KB |
Output is correct |
2 |
Correct |
2099 ms |
748 KB |
Output is correct |
3 |
Correct |
2116 ms |
848 KB |
Output is correct |
4 |
Correct |
2134 ms |
736 KB |
Output is correct |
5 |
Correct |
1913 ms |
624 KB |
Output is correct |
6 |
Correct |
1919 ms |
636 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
9164 ms |
808 KB |
Output is correct |
2 |
Correct |
9132 ms |
976 KB |
Output is correct |
3 |
Correct |
9391 ms |
716 KB |
Output is correct |
4 |
Correct |
9514 ms |
792 KB |
Output is correct |
5 |
Correct |
8148 ms |
816 KB |
Output is correct |
6 |
Correct |
8082 ms |
792 KB |
Output is correct |