#include <bits/stdc++.h>
using namespace std;
#include "dango3.h"
//im suffering from pain
int vis[20005], n, m;
int qry(vector <int> &v){
for(int i=1;i<=m*n;i++)vis[i] = 1;
for(auto i : v)vis[i] = 0;
vector <int> bru;
for(int i=1;i<=n*m;i++)if(vis[i])bru.push_back(i);
return Query(bru);
}
int ok[200005];
void Solve(int N, int M) {
//pain.
n = N, m = M;
vector <int> x;
for(int i=1;i<=n*m;i++){
x.push_back(i);
ok[i] = Query(x);
}
vector < vector <int> > ans;
for(int i=n*m;i>=1;i--){
if(ok[i] != ok[i-1]){
vector <int> hi = {i};
ans.push_back(hi);
}
else{
sort(ans.begin(), ans.end());
for(auto &j : ans){
vector <int> tmp = j;
tmp.push_back(i);
if(qry(tmp) == M - 1){
j.push_back(i);
break;
}
}
}
}
for(auto i : ans)Answer(i);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
340 KB |
Output is correct |
2 |
Correct |
0 ms |
340 KB |
Output is correct |
3 |
Correct |
1 ms |
340 KB |
Output is correct |
4 |
Correct |
1 ms |
304 KB |
Output is correct |
5 |
Correct |
1 ms |
340 KB |
Output is correct |
6 |
Correct |
1 ms |
340 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
32 ms |
536 KB |
Output is correct |
2 |
Correct |
28 ms |
428 KB |
Output is correct |
3 |
Correct |
48 ms |
388 KB |
Output is correct |
4 |
Correct |
51 ms |
388 KB |
Output is correct |
5 |
Correct |
15 ms |
412 KB |
Output is correct |
6 |
Correct |
14 ms |
340 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1297 ms |
576 KB |
Output is correct |
2 |
Correct |
1463 ms |
708 KB |
Output is correct |
3 |
Incorrect |
1977 ms |
704 KB |
Wrong Answer [3] |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
3434 ms |
1012 KB |
Wrong Answer [3] |
2 |
Halted |
0 ms |
0 KB |
- |