이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "dango3.h"
#include <vector>
/*
Find maximum amount by flipping everything
*/
void Solve(int N, int M){
std::vector<int> groups(N*M,-1);
for(int i=0;i<N*M;i++){
int lower=-1,upper=M-1;
while(lower+1<upper){
int mid=(lower+upper)/2;
std::vector<int> ugroup;
for(int j=0;j<N*M;j++){
if(groups[j]!=mid&&j!=i)ugroup.push_back(j+1);
}
if(Query(ugroup)<M-1){
lower=mid;
}else{
upper=mid;
}
}
groups[i]=upper;
}
for(int i=0;i<M;i++){
std::vector<int> curgroup;
for(int j=0;j<N*M;j++){
if(groups[j]==i)curgroup.push_back(j+1);
}
Answer(curgroup);
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |