#include "Annalib.h"
#include <bits/stdc++.h>
void Anna( int N, long long X, int K, int P[] )
{
int mark[N+1] ;
for(int i = 0 ; i <= N ; ++i)
mark[i] = 0 ;
for(int i = 0 ; i < K ; ++i)
mark[P[i]] = 1;
int finished = -1 ;
long long nxt = 0 ;
int cnt = 0 ;
for(int i = 0; i < N; i++ )
{
if(finished == i)
continue ;
if(mark[i+1] == 1|| mark[i] == 1)
Set(i , 0) ;
else if(nxt == 60)
Set(i , 0) ;
else
{
finished = i+1 ;
Set(i , 1) ;
int now = 0 ;
if((X & (1ll << nxt)))
Set(i+1 , 1) ;
else
Set(i+1 , 0) ;
nxt++ ;
}
}
}
#include "Brunolib.h"
#include <bits/stdc++.h>
using namespace std ;
long long Bruno( int N, int A[] )
{
long long ans = 0ll ;
long long nxt = 0 ;
int finished = -1 ;
for(int i = 0 ; i < N ; ++i)
{
if(finished == i)
continue ;
if(A[i] == 0)
continue ;
finished = i+1 ;
if(A[i+1] == 1)
ans += (1ll << nxt) ;
nxt++ ;
}
return ans ;
}
Compilation message
Anna.cpp: In function 'void Anna(int, long long int, int, int*)':
Anna.cpp:26:12: warning: unused variable 'now' [-Wunused-variable]
int now = 0 ;
^~~
Anna.cpp:13:6: warning: unused variable 'cnt' [-Wunused-variable]
int cnt = 0 ;
^~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
4 ms |
888 KB |
Wrong Answer [1] |
2 |
Incorrect |
4 ms |
768 KB |
Wrong Answer [1] |
3 |
Incorrect |
4 ms |
888 KB |
Wrong Answer [1] |
4 |
Incorrect |
4 ms |
984 KB |
Wrong Answer [1] |
5 |
Incorrect |
4 ms |
632 KB |
Wrong Answer [1] |
6 |
Incorrect |
4 ms |
768 KB |
Wrong Answer [1] |
7 |
Incorrect |
4 ms |
852 KB |
Wrong Answer [1] |
8 |
Incorrect |
4 ms |
764 KB |
Wrong Answer [1] |
9 |
Incorrect |
4 ms |
888 KB |
Wrong Answer [1] |
10 |
Incorrect |
4 ms |
760 KB |
Wrong Answer [1] |
11 |
Incorrect |
4 ms |
760 KB |
Wrong Answer [1] |
12 |
Incorrect |
4 ms |
880 KB |
Wrong Answer [1] |
13 |
Incorrect |
4 ms |
760 KB |
Wrong Answer [1] |
14 |
Incorrect |
4 ms |
760 KB |
Wrong Answer [1] |
15 |
Incorrect |
4 ms |
892 KB |
Wrong Answer [1] |
16 |
Incorrect |
4 ms |
764 KB |
Wrong Answer [1] |
17 |
Incorrect |
4 ms |
760 KB |
Wrong Answer [1] |
18 |
Incorrect |
4 ms |
856 KB |
Wrong Answer [1] |
19 |
Incorrect |
4 ms |
860 KB |
Wrong Answer [1] |
20 |
Incorrect |
4 ms |
892 KB |
Wrong Answer [1] |
21 |
Incorrect |
4 ms |
984 KB |
Wrong Answer [1] |
22 |
Incorrect |
4 ms |
764 KB |
Wrong Answer [1] |
23 |
Incorrect |
4 ms |
760 KB |
Wrong Answer [1] |
24 |
Incorrect |
4 ms |
888 KB |
Wrong Answer [1] |
25 |
Incorrect |
4 ms |
888 KB |
Wrong Answer [1] |
26 |
Incorrect |
4 ms |
980 KB |
Wrong Answer [1] |
27 |
Incorrect |
4 ms |
772 KB |
Wrong Answer [1] |
28 |
Incorrect |
4 ms |
1012 KB |
Wrong Answer [1] |
29 |
Incorrect |
4 ms |
888 KB |
Wrong Answer [1] |
30 |
Incorrect |
4 ms |
888 KB |
Wrong Answer [1] |
31 |
Incorrect |
4 ms |
756 KB |
Wrong Answer [1] |
32 |
Incorrect |
4 ms |
760 KB |
Wrong Answer [1] |
33 |
Incorrect |
4 ms |
764 KB |
Wrong Answer [1] |
34 |
Incorrect |
4 ms |
764 KB |
Wrong Answer [1] |
35 |
Incorrect |
4 ms |
888 KB |
Wrong Answer [1] |
36 |
Incorrect |
4 ms |
760 KB |
Wrong Answer [1] |
37 |
Incorrect |
4 ms |
752 KB |
Wrong Answer [1] |
38 |
Incorrect |
4 ms |
772 KB |
Wrong Answer [1] |
39 |
Incorrect |
4 ms |
632 KB |
Wrong Answer [1] |
40 |
Incorrect |
4 ms |
764 KB |
Wrong Answer [1] |