#include "Annalib.h"
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)(n); i ++)
#define rep1(i, n) for(int i = 1; i <= (int)(n); i ++)
#define MP make_pair
using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
bool broken[150];
void Anna(int N, long long X, int K, int P[])
{
rep(i, 150) broken[i] = false;
rep(i, K) broken[P[i]] = true;
int bit = 0;
for(int i = 0; i < N - 2; i += 3) {
vector<int> ids;
if(!broken[i]) ids.push_back(i);
if(!broken[i + 1]) ids.push_back(i + 1);
if(!broken[i + 2]) ids.push_back(i + 2);
if(bit <= 60 && (X >> bit & 1)) {
if(ids.size() >= 2) {
Set(ids[0], 1);
Set(ids[1], 1);
Set(ids[0] ^ ids[1] ^ i ^ (i + 1) ^ (i + 2), 0);
bit ++;
} else {
Set(i, 0);
Set(i + 1, 0);
Set(i + 2, 0);
}
} else {
if(!broken[i]) {
Set(i, 1);
Set(i + 1, 0);
Set(i + 2, 0);
bit ++;
} else if(!broken[i + 1]) {
Set(i, 0);
Set(i + 1, 1);
Set(i + 2, 0);
bit ++;
} else if(!broken[i + 2]) {
Set(i, 0);
Set(i + 1, 0);
Set(i + 2, 1);
bit ++;
} else {
Set(i, 0);
Set(i + 1, 0);
Set(i + 2, 0);
}
}
}
}
#include "Brunolib.h"
#include <bits/stdc++.h>
using namespace std;
long long Bruno(int N, int A[])
{
long long X = 0;
int bit = 0;
for(int i = 0; i < N - 2; i += 3) {
int sum = A[i] + A[i + 1] + A[i + 2];
if(sum == 2) {
X += (1LL << bit);
bit ++;
} else if(sum == 1) {
bit ++;
}
}
return X;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
33 ms |
2468 KB |
Output isn't correct - L* = 0 |
2 |
Partially correct |
33 ms |
2568 KB |
Output isn't correct - L* = 0 |
3 |
Partially correct |
31 ms |
2504 KB |
Output isn't correct - L* = 0 |
4 |
Partially correct |
32 ms |
2592 KB |
Output isn't correct - L* = 0 |
5 |
Partially correct |
31 ms |
2500 KB |
Output isn't correct - L* = 0 |
6 |
Partially correct |
32 ms |
2480 KB |
Output isn't correct - L* = 0 |
7 |
Partially correct |
34 ms |
2600 KB |
Output isn't correct - L* = 0 |
8 |
Partially correct |
41 ms |
2524 KB |
Output isn't correct - L* = 0 |
9 |
Partially correct |
31 ms |
2556 KB |
Output isn't correct - L* = 0 |
10 |
Partially correct |
31 ms |
2508 KB |
Output isn't correct - L* = 0 |
11 |
Partially correct |
31 ms |
2596 KB |
Output isn't correct - L* = 0 |
12 |
Partially correct |
30 ms |
2516 KB |
Output isn't correct - L* = 0 |
13 |
Partially correct |
31 ms |
2716 KB |
Output isn't correct - L* = 0 |
14 |
Partially correct |
31 ms |
2604 KB |
Output isn't correct - L* = 0 |
15 |
Partially correct |
43 ms |
2484 KB |
Output isn't correct - L* = 0 |
16 |
Partially correct |
32 ms |
2500 KB |
Output isn't correct - L* = 0 |
17 |
Partially correct |
35 ms |
2476 KB |
Output isn't correct - L* = 0 |
18 |
Partially correct |
31 ms |
2500 KB |
Output isn't correct - L* = 0 |
19 |
Partially correct |
31 ms |
2476 KB |
Output isn't correct - L* = 0 |
20 |
Partially correct |
31 ms |
2668 KB |
Output isn't correct - L* = 0 |
21 |
Partially correct |
30 ms |
2584 KB |
Output isn't correct - L* = 0 |
22 |
Partially correct |
33 ms |
2520 KB |
Output isn't correct - L* = 0 |
23 |
Partially correct |
33 ms |
2540 KB |
Output isn't correct - L* = 0 |
24 |
Partially correct |
33 ms |
2468 KB |
Output isn't correct - L* = 0 |
25 |
Partially correct |
37 ms |
2416 KB |
Output isn't correct - L* = 0 |
26 |
Partially correct |
33 ms |
2576 KB |
Output isn't correct - L* = 0 |
27 |
Partially correct |
31 ms |
2412 KB |
Output isn't correct - L* = 0 |
28 |
Partially correct |
31 ms |
2608 KB |
Output isn't correct - L* = 0 |
29 |
Partially correct |
41 ms |
2716 KB |
Output isn't correct - L* = 0 |
30 |
Partially correct |
32 ms |
2564 KB |
Output isn't correct - L* = 0 |
31 |
Partially correct |
32 ms |
2500 KB |
Output isn't correct - L* = 0 |
32 |
Partially correct |
34 ms |
2568 KB |
Output isn't correct - L* = 0 |
33 |
Partially correct |
33 ms |
2604 KB |
Output isn't correct - L* = 0 |
34 |
Partially correct |
31 ms |
2492 KB |
Output isn't correct - L* = 0 |
35 |
Partially correct |
31 ms |
2636 KB |
Output isn't correct - L* = 0 |
36 |
Partially correct |
34 ms |
2576 KB |
Output isn't correct - L* = 0 |
37 |
Partially correct |
37 ms |
2572 KB |
Output isn't correct - L* = 0 |
38 |
Partially correct |
37 ms |
2532 KB |
Output isn't correct - L* = 0 |
39 |
Partially correct |
33 ms |
2500 KB |
Output isn't correct - L* = 0 |
40 |
Partially correct |
31 ms |
2708 KB |
Output isn't correct - L* = 0 |