#include "Annalib.h"
#include<bits/stdc++.h>
using namespace std;
void Anna(int N, long long X, int K, int P[]){
int marc[N + 10];
memset(marc, 0, sizeof(marc));
for(int i = 0; i < K; i++)
marc[P[i]] = 1;
int it1 = 60, it2 = N - 1;
for(; it1 >= 0; it1--){
while((marc[it2] || (marc[it2 - 1] && (1LL << ((long long)it1)))) && it2 > 1) {
Set(it2, 0);
it2--;
}
Set(it2, 1);
it2--;
if((1LL << ((long long)it1)) & X) Set(it2, 1);
else Set(it2, 0);
it2--;
}
while(it2 > 0){
Set(it2, 0);
it2--;
}
return;
}
#include "Brunolib.h"
#include<bits/stdc++.h>
using namespace std;
long long Bruno(int N, int A[]){
int it1 = 60, it2 = N - 1;
long long ret = 0;
for(; it2 > 0; it2--){
if(A[it2]){
it2--;
ret |= ((long long) A[it2]) << (long long)it1;
it1--;
}
if(it1 < 0) break;
}
return ret;
}
Compilation message
Anna.cpp: In function 'void Anna(int, long long int, int, int*)':
Anna.cpp:16:46: warning: '<<' in boolean context, did you mean '<' ? [-Wint-in-bool-context]
16 | while((marc[it2] || (marc[it2 - 1] && (1LL << ((long long)it1)))) && it2 > 1) {
| ~~~~~^~~~~~~~~~~~~~~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
776 KB |
Wrong Answer [1] |
2 |
Incorrect |
0 ms |
644 KB |
Wrong Answer [1] |
3 |
Incorrect |
2 ms |
788 KB |
Wrong Answer [1] |
4 |
Incorrect |
2 ms |
804 KB |
Wrong Answer [4] |
5 |
Incorrect |
2 ms |
1024 KB |
Wrong Answer [1] |
6 |
Incorrect |
0 ms |
780 KB |
Wrong Answer [4] |
7 |
Incorrect |
0 ms |
644 KB |
Wrong Answer [1] |
8 |
Incorrect |
1 ms |
784 KB |
Wrong Answer [1] |
9 |
Incorrect |
1 ms |
644 KB |
Wrong Answer [1] |
10 |
Incorrect |
1 ms |
772 KB |
Wrong Answer [1] |
11 |
Incorrect |
0 ms |
772 KB |
Wrong Answer [1] |
12 |
Incorrect |
1 ms |
780 KB |
Wrong Answer [1] |
13 |
Incorrect |
0 ms |
644 KB |
Wrong Answer [1] |
14 |
Incorrect |
2 ms |
784 KB |
Wrong Answer [1] |
15 |
Incorrect |
1 ms |
772 KB |
Wrong Answer [1] |
16 |
Incorrect |
0 ms |
772 KB |
Wrong Answer [4] |
17 |
Incorrect |
1 ms |
780 KB |
Wrong Answer [4] |
18 |
Incorrect |
1 ms |
644 KB |
Wrong Answer [1] |
19 |
Incorrect |
1 ms |
772 KB |
Wrong Answer [1] |
20 |
Incorrect |
0 ms |
772 KB |
Wrong Answer [4] |
21 |
Incorrect |
1 ms |
788 KB |
Wrong Answer [1] |
22 |
Incorrect |
0 ms |
644 KB |
Wrong Answer [4] |
23 |
Incorrect |
1 ms |
1032 KB |
Wrong Answer [1] |
24 |
Incorrect |
1 ms |
772 KB |
Wrong Answer [1] |
25 |
Incorrect |
0 ms |
644 KB |
Wrong Answer [1] |
26 |
Incorrect |
1 ms |
1032 KB |
Wrong Answer [4] |
27 |
Incorrect |
1 ms |
776 KB |
Wrong Answer [1] |
28 |
Incorrect |
2 ms |
644 KB |
Wrong Answer [1] |
29 |
Incorrect |
1 ms |
1040 KB |
Wrong Answer [1] |
30 |
Incorrect |
0 ms |
644 KB |
Wrong Answer [1] |
31 |
Incorrect |
1 ms |
1032 KB |
Wrong Answer [1] |
32 |
Incorrect |
0 ms |
644 KB |
Wrong Answer [1] |
33 |
Incorrect |
1 ms |
772 KB |
Wrong Answer [1] |
34 |
Incorrect |
0 ms |
772 KB |
Wrong Answer [1] |
35 |
Incorrect |
2 ms |
780 KB |
Wrong Answer [1] |
36 |
Incorrect |
0 ms |
644 KB |
Wrong Answer [1] |
37 |
Incorrect |
1 ms |
772 KB |
Wrong Answer [1] |
38 |
Incorrect |
0 ms |
788 KB |
Wrong Answer [1] |
39 |
Incorrect |
0 ms |
788 KB |
Wrong Answer [4] |
40 |
Incorrect |
1 ms |
788 KB |
Wrong Answer [1] |