#include "Annalib.h"
#include <bits/stdc++.h>
#define sc second
#define fr first
#define pb push_back
#define mk make_pair
using namespace std;
string bin(long long x) {
string a = "";
while(x) {
a += (char)(x % 2 + '0');
x /= 2;
}
return a;
}
int u[200];
int ind;
void Anna( int n, long long x, int k, int p[] ){
string s = bin(x);
memset(u,0,sizeof(u));
ind = 0;
for (int i = 0; i < k; i ++)
u[p[i]] = 1;
for (int i = 0; i < n; i ++) {
if (ind >= (int)s.size()) {
Set(i,0);
continue;
}
if (i + 1 < n && u[i] + u[i + 1] < 1) {
Set(i,1);
Set(i + 1,(int)(s[ind] - '0'));
ind ++;
i ++;
while (i + 1 < n && s[ind - 1] == '1' && s[ind] == '1' && ind < (int)s.size() && u[i + 1] == 0) {
Set(i + 1,(int)(s[ind] - '0'));
ind ++;
i ++;
}
i ++;
Set(i,0);
}
else {
Set(i,0);
}
}
}
#include "Brunolib.h"
#include <bits/stdc++.h>
#define sc second
#define fr first
#define pb push_back
#define mk make_pair
using namespace std;
long long ans;
long long cnt;
long long Bruno( int N, int a[] ){
ans = 0;
cnt = 0;
for (int i = 0; i < N - 1; i ++) {
if (a[i] == 1) {
ans += (1ll << cnt) * 1ll * a[i + 1];
// cout << i + 1 << endl;
cnt ++;
i ++;
while (a[i] == 1 && a[i + 1] == 1 && i + 1 < N) {
ans += (1ll << cnt) * 1ll * a[i + 1];
// cout << i + 1 << endl;
cnt ++;
i ++;
}
}
}
return ans;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
5 ms |
756 KB |
Wrong Answer [1] |
2 |
Incorrect |
6 ms |
1100 KB |
Wrong Answer [1] |
3 |
Incorrect |
6 ms |
1184 KB |
Wrong Answer [1] |
4 |
Incorrect |
6 ms |
1184 KB |
Wrong Answer [1] |
5 |
Incorrect |
6 ms |
1184 KB |
Wrong Answer [1] |
6 |
Incorrect |
5 ms |
1480 KB |
Wrong Answer [1] |
7 |
Incorrect |
5 ms |
1536 KB |
Wrong Answer [1] |
8 |
Incorrect |
4 ms |
1536 KB |
Wrong Answer [1] |
9 |
Incorrect |
5 ms |
1536 KB |
Wrong Answer [1] |
10 |
Incorrect |
6 ms |
1536 KB |
Wrong Answer [1] |
11 |
Incorrect |
5 ms |
1536 KB |
Wrong Answer [1] |
12 |
Incorrect |
6 ms |
1536 KB |
Wrong Answer [1] |
13 |
Incorrect |
4 ms |
1536 KB |
Wrong Answer [1] |
14 |
Incorrect |
6 ms |
1536 KB |
Wrong Answer [1] |
15 |
Incorrect |
4 ms |
1536 KB |
Wrong Answer [1] |
16 |
Incorrect |
6 ms |
1536 KB |
Wrong Answer [1] |
17 |
Incorrect |
4 ms |
1536 KB |
Wrong Answer [1] |
18 |
Incorrect |
5 ms |
1536 KB |
Wrong Answer [1] |
19 |
Incorrect |
4 ms |
1536 KB |
Wrong Answer [1] |
20 |
Incorrect |
6 ms |
1536 KB |
Wrong Answer [1] |
21 |
Incorrect |
5 ms |
1536 KB |
Wrong Answer [1] |
22 |
Incorrect |
5 ms |
1536 KB |
Wrong Answer [1] |
23 |
Incorrect |
5 ms |
1536 KB |
Wrong Answer [1] |
24 |
Incorrect |
5 ms |
1536 KB |
Wrong Answer [1] |
25 |
Incorrect |
5 ms |
1536 KB |
Wrong Answer [1] |
26 |
Incorrect |
6 ms |
1536 KB |
Wrong Answer [1] |
27 |
Incorrect |
5 ms |
1536 KB |
Wrong Answer [1] |
28 |
Incorrect |
4 ms |
1536 KB |
Wrong Answer [1] |
29 |
Incorrect |
4 ms |
1536 KB |
Wrong Answer [1] |
30 |
Incorrect |
4 ms |
1536 KB |
Wrong Answer [1] |
31 |
Incorrect |
4 ms |
1536 KB |
Wrong Answer [1] |
32 |
Incorrect |
4 ms |
1536 KB |
Wrong Answer [1] |
33 |
Incorrect |
6 ms |
1536 KB |
Wrong Answer [1] |
34 |
Incorrect |
5 ms |
1536 KB |
Wrong Answer [1] |
35 |
Incorrect |
4 ms |
1536 KB |
Wrong Answer [1] |
36 |
Incorrect |
5 ms |
1536 KB |
Wrong Answer [1] |
37 |
Incorrect |
4 ms |
1536 KB |
Wrong Answer [1] |
38 |
Incorrect |
6 ms |
1536 KB |
Wrong Answer [1] |
39 |
Incorrect |
4 ms |
1536 KB |
Wrong Answer [1] |
40 |
Incorrect |
4 ms |
1536 KB |
Wrong Answer [1] |