# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
596789 |
2022-07-15T05:06:07 Z |
반딧불(#8447) |
Super Dango Maker (JOI22_dango3) |
C++17 |
|
395 ms |
596 KB |
#include "dango3.h"
#include <bits/stdc++.h>
using namespace std;
namespace {
int n, k;
bool used[10002];
bool able(vector<int> vec, int idx, vector<int> &keyVec){
while(idx--) vec.pop_back();
for(auto x: keyVec) vec.push_back(x);
return Query(vec) > 0;
}
}
void Solve(int N, int M){
n = N, k = M;
for(int turn=1; turn<=k; turn++){
vector<int> vec;
vector<int> important;
for(int i=1; i<=n*k; i++) if(!used[i]) vec.push_back(i);
for(int key=1; key<=n; key++){
int l=1, r=(int)vec.size(), ans=0;
while(l<=r){
int m = (l+r)/2;
if(able(vec, m, important)) ans = m, l = m+1;
else r = m-1;
}
while(ans--) vec.pop_back();
important.push_back(vec.back());
used[vec.back()] = 1;
vec.pop_back();
}
Answer(important);
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
340 KB |
Output is correct |
2 |
Correct |
1 ms |
340 KB |
Output is correct |
3 |
Correct |
0 ms |
340 KB |
Output is correct |
4 |
Correct |
0 ms |
340 KB |
Output is correct |
5 |
Correct |
0 ms |
340 KB |
Output is correct |
6 |
Correct |
0 ms |
340 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
7 ms |
340 KB |
Output is correct |
2 |
Correct |
7 ms |
392 KB |
Output is correct |
3 |
Correct |
16 ms |
404 KB |
Output is correct |
4 |
Correct |
17 ms |
408 KB |
Output is correct |
5 |
Correct |
5 ms |
340 KB |
Output is correct |
6 |
Correct |
5 ms |
388 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
85 ms |
596 KB |
Output is correct |
2 |
Correct |
84 ms |
476 KB |
Output is correct |
3 |
Correct |
376 ms |
596 KB |
Output is correct |
4 |
Correct |
395 ms |
508 KB |
Output is correct |
5 |
Correct |
53 ms |
568 KB |
Output is correct |
6 |
Correct |
53 ms |
476 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
268 ms |
516 KB |
Wrong Answer [3] |
2 |
Halted |
0 ms |
0 KB |
- |