Submission #1020115

#TimeUsernameProblemLanguageResultExecution timeMemory
1020115isaachewSuper Dango Maker (JOI22_dango3)C++17
100 / 100
2473 ms732 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...