#include "Anna.h"
#include <bits/stdc++.h>
using namespace std;
int Declare() {
return 2000;
}
pair<vector<int>, vector<int>> Anna(long long x) {
vector<int> a, b;
int lg = 27, k = 70;
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;
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 + 70; j++) {
fg |= u[j];
}
if(fg) {
ans |= (1 << b);
int cnt = 0, j = i;
while(cnt < 70) {
j++;
cnt += u[j];
}
i = j;
}
b++;
}
return ans;
}
Compilation message
Bruno.cpp: In function 'long long int Bruno(std::vector<int>)':
Bruno.cpp:8:9: warning: unused variable 'n' [-Wunused-variable]
8 | int n = (int) u.size();
| ^
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
792 KB |
Output is correct |
2 |
Correct |
490 ms |
31168 KB |
Output is correct |
3 |
Correct |
467 ms |
31268 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
792 KB |
Output is correct |
2 |
Correct |
490 ms |
31168 KB |
Output is correct |
3 |
Correct |
467 ms |
31268 KB |
Output is correct |
4 |
Correct |
471 ms |
31180 KB |
Output is correct |
5 |
Correct |
490 ms |
31332 KB |
Output is correct |
6 |
Correct |
467 ms |
31176 KB |
Output is correct |
7 |
Correct |
475 ms |
31204 KB |
Output is correct |
8 |
Correct |
511 ms |
31416 KB |
Output is correct |
9 |
Correct |
468 ms |
31268 KB |
Output is correct |
10 |
Correct |
469 ms |
31320 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
792 KB |
Output is correct |
2 |
Correct |
490 ms |
31168 KB |
Output is correct |
3 |
Correct |
467 ms |
31268 KB |
Output is correct |
4 |
Correct |
471 ms |
31180 KB |
Output is correct |
5 |
Correct |
490 ms |
31332 KB |
Output is correct |
6 |
Correct |
467 ms |
31176 KB |
Output is correct |
7 |
Correct |
475 ms |
31204 KB |
Output is correct |
8 |
Correct |
511 ms |
31416 KB |
Output is correct |
9 |
Correct |
468 ms |
31268 KB |
Output is correct |
10 |
Correct |
469 ms |
31320 KB |
Output is correct |
11 |
Correct |
473 ms |
31176 KB |
Output is correct |
12 |
Correct |
477 ms |
31228 KB |
Output is correct |
13 |
Correct |
448 ms |
31260 KB |
Output is correct |
14 |
Correct |
458 ms |
31204 KB |
Output is correct |
15 |
Correct |
466 ms |
31468 KB |
Output is correct |
16 |
Correct |
436 ms |
31300 KB |
Output is correct |
17 |
Correct |
461 ms |
31300 KB |
Output is correct |
18 |
Correct |
475 ms |
31156 KB |
Output is correct |
19 |
Correct |
471 ms |
31176 KB |
Output is correct |
20 |
Correct |
473 ms |
31412 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
792 KB |
Output is correct |
2 |
Correct |
490 ms |
31168 KB |
Output is correct |
3 |
Correct |
467 ms |
31268 KB |
Output is correct |
4 |
Correct |
471 ms |
31180 KB |
Output is correct |
5 |
Correct |
490 ms |
31332 KB |
Output is correct |
6 |
Correct |
467 ms |
31176 KB |
Output is correct |
7 |
Correct |
475 ms |
31204 KB |
Output is correct |
8 |
Correct |
511 ms |
31416 KB |
Output is correct |
9 |
Correct |
468 ms |
31268 KB |
Output is correct |
10 |
Correct |
469 ms |
31320 KB |
Output is correct |
11 |
Correct |
473 ms |
31176 KB |
Output is correct |
12 |
Correct |
477 ms |
31228 KB |
Output is correct |
13 |
Correct |
448 ms |
31260 KB |
Output is correct |
14 |
Correct |
458 ms |
31204 KB |
Output is correct |
15 |
Correct |
466 ms |
31468 KB |
Output is correct |
16 |
Correct |
436 ms |
31300 KB |
Output is correct |
17 |
Correct |
461 ms |
31300 KB |
Output is correct |
18 |
Correct |
475 ms |
31156 KB |
Output is correct |
19 |
Correct |
471 ms |
31176 KB |
Output is correct |
20 |
Correct |
473 ms |
31412 KB |
Output is correct |
21 |
Correct |
472 ms |
31188 KB |
Output is correct |
22 |
Correct |
475 ms |
31192 KB |
Output is correct |
23 |
Correct |
455 ms |
31212 KB |
Output is correct |
24 |
Correct |
478 ms |
31224 KB |
Output is correct |
25 |
Correct |
495 ms |
31224 KB |
Output is correct |
26 |
Correct |
495 ms |
31148 KB |
Output is correct |
27 |
Correct |
441 ms |
31356 KB |
Output is correct |
28 |
Correct |
470 ms |
31460 KB |
Output is correct |
29 |
Correct |
461 ms |
31296 KB |
Output is correct |
30 |
Correct |
471 ms |
31308 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
792 KB |
Output is correct |
2 |
Correct |
490 ms |
31168 KB |
Output is correct |
3 |
Correct |
467 ms |
31268 KB |
Output is correct |
4 |
Correct |
471 ms |
31180 KB |
Output is correct |
5 |
Correct |
490 ms |
31332 KB |
Output is correct |
6 |
Correct |
467 ms |
31176 KB |
Output is correct |
7 |
Correct |
475 ms |
31204 KB |
Output is correct |
8 |
Correct |
511 ms |
31416 KB |
Output is correct |
9 |
Correct |
468 ms |
31268 KB |
Output is correct |
10 |
Correct |
469 ms |
31320 KB |
Output is correct |
11 |
Correct |
473 ms |
31176 KB |
Output is correct |
12 |
Correct |
477 ms |
31228 KB |
Output is correct |
13 |
Correct |
448 ms |
31260 KB |
Output is correct |
14 |
Correct |
458 ms |
31204 KB |
Output is correct |
15 |
Correct |
466 ms |
31468 KB |
Output is correct |
16 |
Correct |
436 ms |
31300 KB |
Output is correct |
17 |
Correct |
461 ms |
31300 KB |
Output is correct |
18 |
Correct |
475 ms |
31156 KB |
Output is correct |
19 |
Correct |
471 ms |
31176 KB |
Output is correct |
20 |
Correct |
473 ms |
31412 KB |
Output is correct |
21 |
Correct |
472 ms |
31188 KB |
Output is correct |
22 |
Correct |
475 ms |
31192 KB |
Output is correct |
23 |
Correct |
455 ms |
31212 KB |
Output is correct |
24 |
Correct |
478 ms |
31224 KB |
Output is correct |
25 |
Correct |
495 ms |
31224 KB |
Output is correct |
26 |
Correct |
495 ms |
31148 KB |
Output is correct |
27 |
Correct |
441 ms |
31356 KB |
Output is correct |
28 |
Correct |
470 ms |
31460 KB |
Output is correct |
29 |
Correct |
461 ms |
31296 KB |
Output is correct |
30 |
Correct |
471 ms |
31308 KB |
Output is correct |
31 |
Incorrect |
493 ms |
31392 KB |
Output isn't correct |
32 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
480 ms |
31368 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |