#include "Anna.h"
#include <bits/stdc++.h>
using namespace std;
int Declare() {
return 1080;
}
pair<vector<int>, vector<int>> Anna(long long x) {
vector<int> a, b;
int lg = 60, k = 17;
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 k = 17;
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 + k; j++) {
fg |= u[j];
}
if(fg) {
ans |= (1ll << b);
int cnt = 0, j = i;
while(cnt < k) {
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();
| ^
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
784 KB |
Output is correct |
2 |
Correct |
273 ms |
17872 KB |
Output is correct |
3 |
Correct |
260 ms |
17924 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
784 KB |
Output is correct |
2 |
Correct |
273 ms |
17872 KB |
Output is correct |
3 |
Correct |
260 ms |
17924 KB |
Output is correct |
4 |
Correct |
262 ms |
18028 KB |
Output is correct |
5 |
Correct |
266 ms |
17848 KB |
Output is correct |
6 |
Correct |
266 ms |
17932 KB |
Output is correct |
7 |
Correct |
261 ms |
17924 KB |
Output is correct |
8 |
Correct |
270 ms |
17924 KB |
Output is correct |
9 |
Correct |
305 ms |
17980 KB |
Output is correct |
10 |
Correct |
249 ms |
17816 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
784 KB |
Output is correct |
2 |
Correct |
273 ms |
17872 KB |
Output is correct |
3 |
Correct |
260 ms |
17924 KB |
Output is correct |
4 |
Correct |
262 ms |
18028 KB |
Output is correct |
5 |
Correct |
266 ms |
17848 KB |
Output is correct |
6 |
Correct |
266 ms |
17932 KB |
Output is correct |
7 |
Correct |
261 ms |
17924 KB |
Output is correct |
8 |
Correct |
270 ms |
17924 KB |
Output is correct |
9 |
Correct |
305 ms |
17980 KB |
Output is correct |
10 |
Correct |
249 ms |
17816 KB |
Output is correct |
11 |
Correct |
301 ms |
17816 KB |
Output is correct |
12 |
Correct |
304 ms |
17824 KB |
Output is correct |
13 |
Correct |
286 ms |
17816 KB |
Output is correct |
14 |
Correct |
267 ms |
17928 KB |
Output is correct |
15 |
Correct |
263 ms |
17848 KB |
Output is correct |
16 |
Correct |
282 ms |
17924 KB |
Output is correct |
17 |
Correct |
266 ms |
17852 KB |
Output is correct |
18 |
Correct |
270 ms |
17848 KB |
Output is correct |
19 |
Correct |
272 ms |
17844 KB |
Output is correct |
20 |
Correct |
278 ms |
17852 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
784 KB |
Output is correct |
2 |
Correct |
273 ms |
17872 KB |
Output is correct |
3 |
Correct |
260 ms |
17924 KB |
Output is correct |
4 |
Correct |
262 ms |
18028 KB |
Output is correct |
5 |
Correct |
266 ms |
17848 KB |
Output is correct |
6 |
Correct |
266 ms |
17932 KB |
Output is correct |
7 |
Correct |
261 ms |
17924 KB |
Output is correct |
8 |
Correct |
270 ms |
17924 KB |
Output is correct |
9 |
Correct |
305 ms |
17980 KB |
Output is correct |
10 |
Correct |
249 ms |
17816 KB |
Output is correct |
11 |
Correct |
301 ms |
17816 KB |
Output is correct |
12 |
Correct |
304 ms |
17824 KB |
Output is correct |
13 |
Correct |
286 ms |
17816 KB |
Output is correct |
14 |
Correct |
267 ms |
17928 KB |
Output is correct |
15 |
Correct |
263 ms |
17848 KB |
Output is correct |
16 |
Correct |
282 ms |
17924 KB |
Output is correct |
17 |
Correct |
266 ms |
17852 KB |
Output is correct |
18 |
Correct |
270 ms |
17848 KB |
Output is correct |
19 |
Correct |
272 ms |
17844 KB |
Output is correct |
20 |
Correct |
278 ms |
17852 KB |
Output is correct |
21 |
Correct |
278 ms |
17928 KB |
Output is correct |
22 |
Correct |
256 ms |
17800 KB |
Output is correct |
23 |
Correct |
254 ms |
17852 KB |
Output is correct |
24 |
Correct |
252 ms |
18004 KB |
Output is correct |
25 |
Correct |
275 ms |
17804 KB |
Output is correct |
26 |
Correct |
249 ms |
17956 KB |
Output is correct |
27 |
Correct |
251 ms |
17840 KB |
Output is correct |
28 |
Correct |
268 ms |
17828 KB |
Output is correct |
29 |
Correct |
266 ms |
18112 KB |
Output is correct |
30 |
Correct |
276 ms |
17820 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
784 KB |
Output is correct |
2 |
Correct |
273 ms |
17872 KB |
Output is correct |
3 |
Correct |
260 ms |
17924 KB |
Output is correct |
4 |
Correct |
262 ms |
18028 KB |
Output is correct |
5 |
Correct |
266 ms |
17848 KB |
Output is correct |
6 |
Correct |
266 ms |
17932 KB |
Output is correct |
7 |
Correct |
261 ms |
17924 KB |
Output is correct |
8 |
Correct |
270 ms |
17924 KB |
Output is correct |
9 |
Correct |
305 ms |
17980 KB |
Output is correct |
10 |
Correct |
249 ms |
17816 KB |
Output is correct |
11 |
Correct |
301 ms |
17816 KB |
Output is correct |
12 |
Correct |
304 ms |
17824 KB |
Output is correct |
13 |
Correct |
286 ms |
17816 KB |
Output is correct |
14 |
Correct |
267 ms |
17928 KB |
Output is correct |
15 |
Correct |
263 ms |
17848 KB |
Output is correct |
16 |
Correct |
282 ms |
17924 KB |
Output is correct |
17 |
Correct |
266 ms |
17852 KB |
Output is correct |
18 |
Correct |
270 ms |
17848 KB |
Output is correct |
19 |
Correct |
272 ms |
17844 KB |
Output is correct |
20 |
Correct |
278 ms |
17852 KB |
Output is correct |
21 |
Correct |
278 ms |
17928 KB |
Output is correct |
22 |
Correct |
256 ms |
17800 KB |
Output is correct |
23 |
Correct |
254 ms |
17852 KB |
Output is correct |
24 |
Correct |
252 ms |
18004 KB |
Output is correct |
25 |
Correct |
275 ms |
17804 KB |
Output is correct |
26 |
Correct |
249 ms |
17956 KB |
Output is correct |
27 |
Correct |
251 ms |
17840 KB |
Output is correct |
28 |
Correct |
268 ms |
17828 KB |
Output is correct |
29 |
Correct |
266 ms |
18112 KB |
Output is correct |
30 |
Correct |
276 ms |
17820 KB |
Output is correct |
31 |
Correct |
267 ms |
18104 KB |
Output is correct |
32 |
Correct |
279 ms |
17844 KB |
Output is correct |
33 |
Correct |
287 ms |
17932 KB |
Output is correct |
34 |
Correct |
276 ms |
17924 KB |
Output is correct |
35 |
Correct |
292 ms |
17996 KB |
Output is correct |
36 |
Correct |
276 ms |
17932 KB |
Output is correct |
37 |
Correct |
271 ms |
17844 KB |
Output is correct |
38 |
Correct |
280 ms |
17848 KB |
Output is correct |
39 |
Correct |
265 ms |
17816 KB |
Output is correct |
40 |
Correct |
278 ms |
17916 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
268 ms |
18004 KB |
Output is partially correct |
2 |
Incorrect |
279 ms |
18048 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |