#include<bits/stdc++.h>
#include <cstdio>
#include <vector>
#include "library.h"
using namespace std;
void Solve(int N)
{
int n=N;
vector<int> M(N);
for(int i = 0; i < N; i++) {
M[i] = 1;
}
int border = -1;
for(int i = 0; i < n ; i++){
M[i] = 0;
int r = Query(M);
if(r==1){
//border
border = i;
break;
}
M[i] = 1;
}
bool in[n];
fill(in,in+n,false);
in[border] = true;
vector<vector<int>> chaines;
int tot = 1;
while(tot<N){
vector<int> chaine;
vector<int> q(n);
fill(q.begin(),q.end(),0);
for(int i = 0;i<n;i++){
if(!in[i]){
q[i] = 1;
if(Query(q)==(int)chaine.size()+1){
chaine.push_back(i);
tot++;
in[i] = true;
}else{
q[i] = 0;
}
}
}
chaines.push_back(chaine);
}
vector<int> ans;
ans.push_back(border);
vector<int> asking(n);
fill(asking.begin(),asking.end(),0);
asking[border] = 1;
for(int i = 0;i<n;i++)ans[i]++;
Answer(ans);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
3 ms |
344 KB |
Wrong Answer [4] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
3 ms |
344 KB |
Wrong Answer [4] |
2 |
Halted |
0 ms |
0 KB |
- |