#include "dango3.h"
#include <bits/stdc++.h>
using namespace std;
namespace {
int n;
set<int> s,t;
vector<int> v,q;
void solve(){
if((int)v.size()==n){
Answer(v);
return;
}
int dangos=(int)v.size()/n;
int d=(dangos+1)/2;
s.clear();t.clear();
for(int i:v)s.insert(i);
for(auto it=s.begin();it!=s.end();++it){
for(auto it2=s.begin();it2!=s.end();++it){
if(it2==it)continue;
q.push_back(*it2);
}
if(Query(q)>=d){
t.insert(*it);
s.erase(it);
if((int)s.size()==d*n)break;
}
q.clear();
}
q.clear();
v.clear();
for(int i:s)v.push_back(i);
solve();
v.clear();
for(int i:t)v.push_back(i);
solve();
v.clear();
}
}
void Solve(int N, int M) {
n=N;
for(int i=0;i<N;i++){
for(int j=0;j<M;j++){
v.push_back(M*i+j+1);
}
}
solve();
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1491 ms |
1048576 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
2692 ms |
1048576 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
3336 ms |
1048576 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
6644 ms |
1048576 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |