#include "Anna.h"
#include <bits/stdc++.h>
using namespace std;
int lg = 60, k = 21;
int Declare() {
return lg * (k + 1);
}
pair<vector<int>, vector<int>> Anna(long long x) {
vector<int> a, b;
a.push_back(0);
for(int i = 0; i < lg; i++) {
int t = ((x >> i) & 1);
for(int j = 0; j < k; j++){
a.push_back(!t);
}
if(i + 1 < lg) a.push_back(0);
}
while(b.size() < a.size()) {
b.push_back(1);
}
return {a, b};
}
#include "Bruno.h"
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
int tk = 21;
long long Bruno(vector<int> u) {
for(int &x : u) {
x ^= 1;
}
int n = (int) u.size();
ll ans = 0, b = 0;
for(int i = 0; i + 1 < (int)u.size(); i++) {
if(u[i] == 0) {
continue;
}
int fg = 0;
for(int j = i + 1; j <= i + tk; j++) {
fg |= u[j];
}
if(fg) {
ans |= (1ll << b);
int cnt = 0, j = i;
while(cnt < tk) {
j++;
cnt += u[j];
}
i = j;
}
b++;
}
return ans;
}
Compilation message
Bruno.cpp: In function 'long long int Bruno(std::vector<int>)':
Bruno.cpp:13:9: warning: unused variable 'n' [-Wunused-variable]
13 | int n = (int) u.size();
| ^
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
784 KB |
Output is correct |
2 |
Correct |
321 ms |
21632 KB |
Output is correct |
3 |
Correct |
310 ms |
21824 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
784 KB |
Output is correct |
2 |
Correct |
321 ms |
21632 KB |
Output is correct |
3 |
Correct |
310 ms |
21824 KB |
Output is correct |
4 |
Correct |
338 ms |
21672 KB |
Output is correct |
5 |
Correct |
348 ms |
21612 KB |
Output is correct |
6 |
Correct |
341 ms |
21604 KB |
Output is correct |
7 |
Correct |
336 ms |
21636 KB |
Output is correct |
8 |
Correct |
336 ms |
21716 KB |
Output is correct |
9 |
Correct |
332 ms |
21636 KB |
Output is correct |
10 |
Correct |
333 ms |
21632 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
784 KB |
Output is correct |
2 |
Correct |
321 ms |
21632 KB |
Output is correct |
3 |
Correct |
310 ms |
21824 KB |
Output is correct |
4 |
Correct |
338 ms |
21672 KB |
Output is correct |
5 |
Correct |
348 ms |
21612 KB |
Output is correct |
6 |
Correct |
341 ms |
21604 KB |
Output is correct |
7 |
Correct |
336 ms |
21636 KB |
Output is correct |
8 |
Correct |
336 ms |
21716 KB |
Output is correct |
9 |
Correct |
332 ms |
21636 KB |
Output is correct |
10 |
Correct |
333 ms |
21632 KB |
Output is correct |
11 |
Correct |
331 ms |
21636 KB |
Output is correct |
12 |
Correct |
357 ms |
21944 KB |
Output is correct |
13 |
Correct |
339 ms |
21712 KB |
Output is correct |
14 |
Correct |
337 ms |
21688 KB |
Output is correct |
15 |
Correct |
330 ms |
21708 KB |
Output is correct |
16 |
Correct |
332 ms |
21724 KB |
Output is correct |
17 |
Correct |
320 ms |
21744 KB |
Output is correct |
18 |
Correct |
339 ms |
21752 KB |
Output is correct |
19 |
Correct |
327 ms |
21628 KB |
Output is correct |
20 |
Incorrect |
384 ms |
21852 KB |
Output isn't correct |
21 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
784 KB |
Output is correct |
2 |
Correct |
321 ms |
21632 KB |
Output is correct |
3 |
Correct |
310 ms |
21824 KB |
Output is correct |
4 |
Correct |
338 ms |
21672 KB |
Output is correct |
5 |
Correct |
348 ms |
21612 KB |
Output is correct |
6 |
Correct |
341 ms |
21604 KB |
Output is correct |
7 |
Correct |
336 ms |
21636 KB |
Output is correct |
8 |
Correct |
336 ms |
21716 KB |
Output is correct |
9 |
Correct |
332 ms |
21636 KB |
Output is correct |
10 |
Correct |
333 ms |
21632 KB |
Output is correct |
11 |
Correct |
331 ms |
21636 KB |
Output is correct |
12 |
Correct |
357 ms |
21944 KB |
Output is correct |
13 |
Correct |
339 ms |
21712 KB |
Output is correct |
14 |
Correct |
337 ms |
21688 KB |
Output is correct |
15 |
Correct |
330 ms |
21708 KB |
Output is correct |
16 |
Correct |
332 ms |
21724 KB |
Output is correct |
17 |
Correct |
320 ms |
21744 KB |
Output is correct |
18 |
Correct |
339 ms |
21752 KB |
Output is correct |
19 |
Correct |
327 ms |
21628 KB |
Output is correct |
20 |
Incorrect |
384 ms |
21852 KB |
Output isn't correct |
21 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
784 KB |
Output is correct |
2 |
Correct |
321 ms |
21632 KB |
Output is correct |
3 |
Correct |
310 ms |
21824 KB |
Output is correct |
4 |
Correct |
338 ms |
21672 KB |
Output is correct |
5 |
Correct |
348 ms |
21612 KB |
Output is correct |
6 |
Correct |
341 ms |
21604 KB |
Output is correct |
7 |
Correct |
336 ms |
21636 KB |
Output is correct |
8 |
Correct |
336 ms |
21716 KB |
Output is correct |
9 |
Correct |
332 ms |
21636 KB |
Output is correct |
10 |
Correct |
333 ms |
21632 KB |
Output is correct |
11 |
Correct |
331 ms |
21636 KB |
Output is correct |
12 |
Correct |
357 ms |
21944 KB |
Output is correct |
13 |
Correct |
339 ms |
21712 KB |
Output is correct |
14 |
Correct |
337 ms |
21688 KB |
Output is correct |
15 |
Correct |
330 ms |
21708 KB |
Output is correct |
16 |
Correct |
332 ms |
21724 KB |
Output is correct |
17 |
Correct |
320 ms |
21744 KB |
Output is correct |
18 |
Correct |
339 ms |
21752 KB |
Output is correct |
19 |
Correct |
327 ms |
21628 KB |
Output is correct |
20 |
Incorrect |
384 ms |
21852 KB |
Output isn't correct |
21 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Partially correct |
315 ms |
21636 KB |
Output is partially correct |
2 |
Partially correct |
332 ms |
21704 KB |
Output is partially correct |
3 |
Partially correct |
310 ms |
21716 KB |
Output is partially correct |
4 |
Partially correct |
318 ms |
21800 KB |
Output is partially correct |
5 |
Partially correct |
318 ms |
21600 KB |
Output is partially correct |
6 |
Partially correct |
349 ms |
21712 KB |
Output is partially correct |
7 |
Partially correct |
347 ms |
21644 KB |
Output is partially correct |
8 |
Partially correct |
369 ms |
21600 KB |
Output is partially correct |
9 |
Partially correct |
340 ms |
21604 KB |
Output is partially correct |
10 |
Partially correct |
366 ms |
21628 KB |
Output is partially correct |
11 |
Partially correct |
331 ms |
21708 KB |
Output is partially correct |
12 |
Partially correct |
347 ms |
21648 KB |
Output is partially correct |
13 |
Partially correct |
349 ms |
21704 KB |
Output is partially correct |
14 |
Partially correct |
334 ms |
21604 KB |
Output is partially correct |
15 |
Partially correct |
373 ms |
21832 KB |
Output is partially correct |
16 |
Partially correct |
335 ms |
21784 KB |
Output is partially correct |
17 |
Partially correct |
340 ms |
21628 KB |
Output is partially correct |
18 |
Partially correct |
348 ms |
21608 KB |
Output is partially correct |
19 |
Partially correct |
345 ms |
21716 KB |
Output is partially correct |
20 |
Partially correct |
349 ms |
21760 KB |
Output is partially correct |