제출 #1216273

#제출 시각아이디문제언어결과실행 시간메모리
1216273PenguinsAreCuteSuper Dango Maker (JOI22_dango3)C++17
7 / 100
261 ms572 KiB
#include "dango3.h" #include <bits/stdc++.h> using namespace std; void Solve(int N, int M) { bool used[N*M]; memset(used,0,sizeof(used)); for(int i=0;i<M;i++) { vector<int> cur(N, -1); for(int j=0;j<N;j++) { int l = 0, h = 0; for(int i=0;i<N*M;i++) h += !used[i]; while(h - l > 1) { int m = (l + h) / 2; vector<int> qry; int ptr = 0; while(qry.size() < m) { if(!used[ptr]) qry.push_back(ptr+1); ptr++; } for(auto k: cur) if(~k) qry.push_back(k); if(Query(qry)) h = m; else l = m; } int ptr = -1, cnt = 0; while(cnt <= l) { if(!used[++ptr]) cnt++; } used[ptr] = 1; cur[j] = ptr+1; } Answer(cur); } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...