# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
153991 |
2019-09-17T16:22:32 Z |
karma |
Library (JOI18_library) |
C++14 |
|
226 ms |
456 KB |
#include<bits/stdc++.h>
#include "library.h"
#define pb emplace_back
#define ll long long
using namespace std;
const int N = int(2e3) + 7;
vector<int> m, ans, s;
int low, high, mid, cur;
void Solve(int n) {
if(n == 1) {Answer({1}); return;}
m.resize(n, 1); s.resize(n);
for(int i = 0; i < n; ++i) {
m[i] = 0;
if(Query(m) == 1) {cur = i; break;}
m[i] = 1;
}
iota(s.begin(), s.end(), 0);
ans.pb(cur + 1);
s.erase(find(s.begin(), s.end(), cur));
while(s.size()) {
low = 0, high = s.size() - 1;
while(low <= high) {
mid = (low + high) >> 1;
fill(m.begin(), m.end(), 0);
for(int i = 0; i <= mid; ++i) m[s[i]] = 0;
int res = Query(m);
m[cur] = 1;
if(res == Query(m)) high = mid - 1;
else low = mid + 1;
}
cur = s[low];
ans.pb(cur + 1);
s.erase(find(s.begin(), s.end(), cur));
}
Answer(ans);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
10 ms |
376 KB |
Wrong Answer [2] |
2 |
Incorrect |
10 ms |
252 KB |
Wrong Answer [2] |
3 |
Incorrect |
12 ms |
376 KB |
Wrong Answer [2] |
4 |
Incorrect |
11 ms |
248 KB |
Wrong Answer [2] |
5 |
Incorrect |
10 ms |
312 KB |
Wrong Answer [2] |
6 |
Incorrect |
11 ms |
376 KB |
Wrong Answer [2] |
7 |
Incorrect |
10 ms |
312 KB |
Wrong Answer [2] |
8 |
Incorrect |
9 ms |
248 KB |
Wrong Answer [2] |
9 |
Incorrect |
10 ms |
404 KB |
Wrong Answer [2] |
10 |
Incorrect |
6 ms |
320 KB |
Wrong Answer [2] |
11 |
Correct |
2 ms |
376 KB |
# of queries: 0 |
12 |
Incorrect |
2 ms |
376 KB |
Wrong Answer [2] |
13 |
Incorrect |
2 ms |
248 KB |
Wrong Answer [2] |
14 |
Incorrect |
2 ms |
248 KB |
Wrong Answer [2] |
15 |
Incorrect |
2 ms |
248 KB |
Wrong Answer [2] |
16 |
Incorrect |
3 ms |
376 KB |
Wrong Answer [2] |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
10 ms |
376 KB |
Wrong Answer [2] |
2 |
Incorrect |
10 ms |
252 KB |
Wrong Answer [2] |
3 |
Incorrect |
12 ms |
376 KB |
Wrong Answer [2] |
4 |
Incorrect |
11 ms |
248 KB |
Wrong Answer [2] |
5 |
Incorrect |
10 ms |
312 KB |
Wrong Answer [2] |
6 |
Incorrect |
11 ms |
376 KB |
Wrong Answer [2] |
7 |
Incorrect |
10 ms |
312 KB |
Wrong Answer [2] |
8 |
Incorrect |
9 ms |
248 KB |
Wrong Answer [2] |
9 |
Incorrect |
10 ms |
404 KB |
Wrong Answer [2] |
10 |
Incorrect |
6 ms |
320 KB |
Wrong Answer [2] |
11 |
Correct |
2 ms |
376 KB |
# of queries: 0 |
12 |
Incorrect |
2 ms |
376 KB |
Wrong Answer [2] |
13 |
Incorrect |
2 ms |
248 KB |
Wrong Answer [2] |
14 |
Incorrect |
2 ms |
248 KB |
Wrong Answer [2] |
15 |
Incorrect |
2 ms |
248 KB |
Wrong Answer [2] |
16 |
Incorrect |
3 ms |
376 KB |
Wrong Answer [2] |
17 |
Incorrect |
226 ms |
376 KB |
Wrong Answer [2] |
18 |
Incorrect |
203 ms |
324 KB |
Wrong Answer [2] |
19 |
Incorrect |
210 ms |
456 KB |
Wrong Answer [2] |
20 |
Incorrect |
184 ms |
324 KB |
Wrong Answer [2] |
21 |
Incorrect |
173 ms |
336 KB |
Wrong Answer [2] |
22 |
Incorrect |
215 ms |
320 KB |
Wrong Answer [2] |
23 |
Incorrect |
202 ms |
404 KB |
Wrong Answer [2] |
24 |
Incorrect |
53 ms |
376 KB |
Wrong Answer [2] |
25 |
Incorrect |
201 ms |
324 KB |
Wrong Answer [2] |
26 |
Incorrect |
179 ms |
376 KB |
Wrong Answer [2] |
27 |
Incorrect |
58 ms |
248 KB |
Wrong Answer [2] |
28 |
Incorrect |
202 ms |
328 KB |
Wrong Answer [2] |
29 |
Incorrect |
203 ms |
248 KB |
Wrong Answer [2] |
30 |
Incorrect |
202 ms |
376 KB |
Wrong Answer [2] |