제출 #1216278

#제출 시각아이디문제언어결과실행 시간메모리
1216278PenguinsAreCuteSuper Dango Maker (JOI22_dango3)C++17
22 / 100
246 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); int prevL = (M - i) * N; for(int j=0;j<N;j++) { int l = 0, h = prevL; 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; prevL = l; } 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...