#include "Anna.h"
#include <bits/stdc++.h>
using namespace std;
int lg = 60, k = 22;
int Declare() {
return lg * (k + 1);
}
pair<vector<int>, vector<int>> Anna(long long x) {
vector<int> a, b;
a.push_back(1);
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(1);
}
while(b.size() < a.size()) {
b.push_back(0);
}
return {a, b};
}
#include "Bruno.h"
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
int tk = 22;
long long Bruno(vector<int> u) {
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:10:9: warning: unused variable 'n' [-Wunused-variable]
10 | int n = (int) u.size();
| ^
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
772 KB |
Output is correct |
2 |
Correct |
403 ms |
22608 KB |
Output is correct |
3 |
Correct |
326 ms |
22724 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
772 KB |
Output is correct |
2 |
Correct |
403 ms |
22608 KB |
Output is correct |
3 |
Correct |
326 ms |
22724 KB |
Output is correct |
4 |
Correct |
348 ms |
22804 KB |
Output is correct |
5 |
Correct |
353 ms |
22808 KB |
Output is correct |
6 |
Correct |
369 ms |
22896 KB |
Output is correct |
7 |
Correct |
368 ms |
22584 KB |
Output is correct |
8 |
Correct |
341 ms |
22704 KB |
Output is correct |
9 |
Correct |
358 ms |
22716 KB |
Output is correct |
10 |
Correct |
299 ms |
22728 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
772 KB |
Output is correct |
2 |
Correct |
403 ms |
22608 KB |
Output is correct |
3 |
Correct |
326 ms |
22724 KB |
Output is correct |
4 |
Correct |
348 ms |
22804 KB |
Output is correct |
5 |
Correct |
353 ms |
22808 KB |
Output is correct |
6 |
Correct |
369 ms |
22896 KB |
Output is correct |
7 |
Correct |
368 ms |
22584 KB |
Output is correct |
8 |
Correct |
341 ms |
22704 KB |
Output is correct |
9 |
Correct |
358 ms |
22716 KB |
Output is correct |
10 |
Correct |
299 ms |
22728 KB |
Output is correct |
11 |
Correct |
320 ms |
22724 KB |
Output is correct |
12 |
Correct |
328 ms |
22732 KB |
Output is correct |
13 |
Correct |
321 ms |
22724 KB |
Output is correct |
14 |
Correct |
335 ms |
22728 KB |
Output is correct |
15 |
Correct |
318 ms |
22728 KB |
Output is correct |
16 |
Correct |
349 ms |
22636 KB |
Output is correct |
17 |
Correct |
326 ms |
22728 KB |
Output is correct |
18 |
Correct |
370 ms |
22608 KB |
Output is correct |
19 |
Correct |
363 ms |
22816 KB |
Output is correct |
20 |
Correct |
361 ms |
23036 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
772 KB |
Output is correct |
2 |
Correct |
403 ms |
22608 KB |
Output is correct |
3 |
Correct |
326 ms |
22724 KB |
Output is correct |
4 |
Correct |
348 ms |
22804 KB |
Output is correct |
5 |
Correct |
353 ms |
22808 KB |
Output is correct |
6 |
Correct |
369 ms |
22896 KB |
Output is correct |
7 |
Correct |
368 ms |
22584 KB |
Output is correct |
8 |
Correct |
341 ms |
22704 KB |
Output is correct |
9 |
Correct |
358 ms |
22716 KB |
Output is correct |
10 |
Correct |
299 ms |
22728 KB |
Output is correct |
11 |
Correct |
320 ms |
22724 KB |
Output is correct |
12 |
Correct |
328 ms |
22732 KB |
Output is correct |
13 |
Correct |
321 ms |
22724 KB |
Output is correct |
14 |
Correct |
335 ms |
22728 KB |
Output is correct |
15 |
Correct |
318 ms |
22728 KB |
Output is correct |
16 |
Correct |
349 ms |
22636 KB |
Output is correct |
17 |
Correct |
326 ms |
22728 KB |
Output is correct |
18 |
Correct |
370 ms |
22608 KB |
Output is correct |
19 |
Correct |
363 ms |
22816 KB |
Output is correct |
20 |
Correct |
361 ms |
23036 KB |
Output is correct |
21 |
Correct |
352 ms |
22760 KB |
Output is correct |
22 |
Correct |
354 ms |
22872 KB |
Output is correct |
23 |
Correct |
442 ms |
22608 KB |
Output is correct |
24 |
Correct |
337 ms |
22720 KB |
Output is correct |
25 |
Correct |
346 ms |
22680 KB |
Output is correct |
26 |
Correct |
344 ms |
22620 KB |
Output is correct |
27 |
Correct |
349 ms |
22728 KB |
Output is correct |
28 |
Correct |
328 ms |
22664 KB |
Output is correct |
29 |
Correct |
330 ms |
22632 KB |
Output is correct |
30 |
Correct |
320 ms |
22616 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
772 KB |
Output is correct |
2 |
Correct |
403 ms |
22608 KB |
Output is correct |
3 |
Correct |
326 ms |
22724 KB |
Output is correct |
4 |
Correct |
348 ms |
22804 KB |
Output is correct |
5 |
Correct |
353 ms |
22808 KB |
Output is correct |
6 |
Correct |
369 ms |
22896 KB |
Output is correct |
7 |
Correct |
368 ms |
22584 KB |
Output is correct |
8 |
Correct |
341 ms |
22704 KB |
Output is correct |
9 |
Correct |
358 ms |
22716 KB |
Output is correct |
10 |
Correct |
299 ms |
22728 KB |
Output is correct |
11 |
Correct |
320 ms |
22724 KB |
Output is correct |
12 |
Correct |
328 ms |
22732 KB |
Output is correct |
13 |
Correct |
321 ms |
22724 KB |
Output is correct |
14 |
Correct |
335 ms |
22728 KB |
Output is correct |
15 |
Correct |
318 ms |
22728 KB |
Output is correct |
16 |
Correct |
349 ms |
22636 KB |
Output is correct |
17 |
Correct |
326 ms |
22728 KB |
Output is correct |
18 |
Correct |
370 ms |
22608 KB |
Output is correct |
19 |
Correct |
363 ms |
22816 KB |
Output is correct |
20 |
Correct |
361 ms |
23036 KB |
Output is correct |
21 |
Correct |
352 ms |
22760 KB |
Output is correct |
22 |
Correct |
354 ms |
22872 KB |
Output is correct |
23 |
Correct |
442 ms |
22608 KB |
Output is correct |
24 |
Correct |
337 ms |
22720 KB |
Output is correct |
25 |
Correct |
346 ms |
22680 KB |
Output is correct |
26 |
Correct |
344 ms |
22620 KB |
Output is correct |
27 |
Correct |
349 ms |
22728 KB |
Output is correct |
28 |
Correct |
328 ms |
22664 KB |
Output is correct |
29 |
Correct |
330 ms |
22632 KB |
Output is correct |
30 |
Correct |
320 ms |
22616 KB |
Output is correct |
31 |
Correct |
371 ms |
22760 KB |
Output is correct |
32 |
Correct |
322 ms |
22728 KB |
Output is correct |
33 |
Correct |
323 ms |
22616 KB |
Output is correct |
34 |
Correct |
327 ms |
22640 KB |
Output is correct |
35 |
Correct |
349 ms |
22732 KB |
Output is correct |
36 |
Correct |
388 ms |
22636 KB |
Output is correct |
37 |
Correct |
362 ms |
22608 KB |
Output is correct |
38 |
Correct |
343 ms |
22724 KB |
Output is correct |
39 |
Correct |
382 ms |
22856 KB |
Output is correct |
40 |
Correct |
398 ms |
22608 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Partially correct |
377 ms |
22612 KB |
Output is partially correct |
2 |
Partially correct |
360 ms |
22608 KB |
Output is partially correct |
3 |
Partially correct |
383 ms |
22828 KB |
Output is partially correct |
4 |
Partially correct |
392 ms |
22756 KB |
Output is partially correct |
5 |
Partially correct |
400 ms |
22808 KB |
Output is partially correct |
6 |
Partially correct |
391 ms |
22720 KB |
Output is partially correct |
7 |
Partially correct |
369 ms |
22724 KB |
Output is partially correct |
8 |
Partially correct |
376 ms |
22760 KB |
Output is partially correct |
9 |
Partially correct |
356 ms |
22880 KB |
Output is partially correct |
10 |
Partially correct |
368 ms |
22712 KB |
Output is partially correct |
11 |
Partially correct |
348 ms |
22728 KB |
Output is partially correct |
12 |
Partially correct |
410 ms |
22724 KB |
Output is partially correct |
13 |
Partially correct |
397 ms |
22696 KB |
Output is partially correct |
14 |
Partially correct |
395 ms |
22852 KB |
Output is partially correct |
15 |
Partially correct |
383 ms |
22868 KB |
Output is partially correct |
16 |
Partially correct |
392 ms |
22760 KB |
Output is partially correct |
17 |
Partially correct |
399 ms |
22716 KB |
Output is partially correct |
18 |
Partially correct |
400 ms |
22728 KB |
Output is partially correct |
19 |
Partially correct |
401 ms |
22880 KB |
Output is partially correct |
20 |
Partially correct |
397 ms |
22720 KB |
Output is partially correct |