#define DEBUG 0
#include <bits/stdc++.h>
using namespace std;
#if DEBUG
// basic debugging macros
int __i__,__j__;
#define printLine(l) for(__i__=0;__i__<l;__i__++){cout<<"-";}cout<<endl
#define printLine2(l,c) for(__i__=0;__i__<l;__i__++){cout<<c;}cout<<endl
#define printVar(n) cout<<#n<<": "<<n<<endl
#define printArr(a,l) cout<<#a<<": ";for(__i__=0;__i__<l;__i__++){cout<<a[__i__]<<" ";}cout<<endl
#define print2dArr(a,r,c) cout<<#a<<":\n";for(__i__=0;__i__<r;__i__++){for(__j__=0;__j__<c;__j__++){cout<<a[__i__][__j__]<<" ";}cout<<endl;}
#define print2dArr2(a,r,c,l) cout<<#a<<":\n";for(__i__=0;__i__<r;__i__++){for(__j__=0;__j__<c;__j__++){cout<<setw(l)<<setfill(' ')<<a[__i__][__j__]<<" ";}cout<<endl;}
// advanced debugging class
// debug 1,2,'A',"test";
class _Debug {
public:
template<typename T>
_Debug& operator,(T val) {
cout << val << endl;
return *this;
}
};
#define debug _Debug(),
#else
#define printLine(l)
#define printLine2(l,c)
#define printVar(n)
#define printArr(a,l)
#define print2dArr(a,r,c)
#define print2dArr2(a,r,c,l)
#define debug
#endif
// define
#define MAX_VAL 999999999
#define MAX_VAL_2 999999999999999999LL
#define EPS 1e-6
#define mp make_pair
#define pb push_back
// typedef
typedef unsigned int UI;
typedef long long int LLI;
typedef unsigned long long int ULLI;
typedef unsigned short int US;
typedef pair<int,int> pii;
typedef pair<LLI,LLI> plli;
typedef vector<int> vi;
typedef vector<LLI> vlli;
typedef vector<pii> vpii;
typedef vector<plli> vplli;
// ---------- END OF TEMPLATE ----------
#include "Annalib.h"
LLI y = 54795435254253LL;
void Anna(int N,long long int X,int K,int P[]) {
X ^= y;
int i,c = 0,l = -2;
int bad[150];
for (i = 0; i < N; i++) bad[i] = 0;
for (i = 0; i < K; i++) bad[P[i]] = 1;
i = 0;
while (i < N) {
if ((i+3 < N) && !bad[i] && !(bad[i+1] && (X & (1LL << c))) && \
!(bad[i+2] && (X & (1LL << (c+1)))) && !(bad[i+3] && (X & (1LL << (c+2)))) && (l == i-1)) {
Set(i,1);
if (X & (1LL << c)) Set(i+1,1);
else Set(i+1,0);
if (X & (1LL << (c+1))) Set(i+2,1);
else Set(i+2,0);
if (X & (1LL << (c+2))) Set(i+3,1);
else Set(i+3,0);
i += 4,l = i-1,c += 3;
}
else if (l == i-1) Set(i,0),i++;
else if ((i+1 < N) && !bad[i] && !(bad[i+1] && (X & (1LL << c)))) {
Set(i,1);
if (X & (1LL << c)) Set(i+1,1);
else Set(i+1,0);
i += 2,l = i-1,c++;
}
else Set(i,0),i++;
}
}
#define DEBUG 0
#include <bits/stdc++.h>
using namespace std;
#if DEBUG
// basic debugging macros
int __i__,__j__;
#define printLine(l) for(__i__=0;__i__<l;__i__++){cout<<"-";}cout<<endl
#define printLine2(l,c) for(__i__=0;__i__<l;__i__++){cout<<c;}cout<<endl
#define printVar(n) cout<<#n<<": "<<n<<endl
#define printArr(a,l) cout<<#a<<": ";for(__i__=0;__i__<l;__i__++){cout<<a[__i__]<<" ";}cout<<endl
#define print2dArr(a,r,c) cout<<#a<<":\n";for(__i__=0;__i__<r;__i__++){for(__j__=0;__j__<c;__j__++){cout<<a[__i__][__j__]<<" ";}cout<<endl;}
#define print2dArr2(a,r,c,l) cout<<#a<<":\n";for(__i__=0;__i__<r;__i__++){for(__j__=0;__j__<c;__j__++){cout<<setw(l)<<setfill(' ')<<a[__i__][__j__]<<" ";}cout<<endl;}
// advanced debugging class
// debug 1,2,'A',"test";
class _Debug {
public:
template<typename T>
_Debug& operator,(T val) {
cout << val << endl;
return *this;
}
};
#define debug _Debug(),
#else
#define printLine(l)
#define printLine2(l,c)
#define printVar(n)
#define printArr(a,l)
#define print2dArr(a,r,c)
#define print2dArr2(a,r,c,l)
#define debug
#endif
// define
#define MAX_VAL 999999999
#define MAX_VAL_2 999999999999999999LL
#define EPS 1e-6
#define mp make_pair
#define pb push_back
// typedef
typedef unsigned int UI;
typedef long long int LLI;
typedef unsigned long long int ULLI;
typedef unsigned short int US;
typedef pair<int,int> pii;
typedef pair<LLI,LLI> plli;
typedef vector<int> vi;
typedef vector<LLI> vlli;
typedef vector<pii> vpii;
typedef vector<plli> vplli;
// ---------- END OF TEMPLATE ----------
#include "Brunolib.h"
LLI yy = 54795435254253LL;
long long int Bruno(int N,int A[]) {
int i = 0,l = -2,c = 0;
LLI X = 0;
while (i < N) {
if ((i+3 < N) && A[i] && (l == i-1)) {
if (A[i+1]) X |= (1LL << c);
if (A[i+2]) X |= (1LL << (c+1));
if (A[i+3]) X |= (1LL << (c+2));
i += 4,l = i-1,c += 3;
}
else if ((i+1 < N) && A[i]) {
if (A[i+1]) X |= (1LL << c);
i += 2,l = i-1,c++;
}
else i++;
}
X ^= yy;
return X;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
41 ms |
2328 KB |
Output is partially correct - L* = 36 |
2 |
Partially correct |
41 ms |
2244 KB |
Output is partially correct - L* = 37 |
3 |
Partially correct |
44 ms |
2284 KB |
Output is partially correct - L* = 35 |
4 |
Partially correct |
42 ms |
2208 KB |
Output is partially correct - L* = 35 |
5 |
Partially correct |
41 ms |
2304 KB |
Output is partially correct - L* = 33 |
6 |
Partially correct |
41 ms |
2328 KB |
Output is partially correct - L* = 34 |
7 |
Partially correct |
41 ms |
2172 KB |
Output is partially correct - L* = 37 |
8 |
Partially correct |
42 ms |
2248 KB |
Output is partially correct - L* = 34 |
9 |
Partially correct |
42 ms |
2208 KB |
Output is partially correct - L* = 36 |
10 |
Partially correct |
40 ms |
2324 KB |
Output is partially correct - L* = 35 |
11 |
Partially correct |
42 ms |
2176 KB |
Output is partially correct - L* = 34 |
12 |
Partially correct |
42 ms |
2304 KB |
Output is partially correct - L* = 37 |
13 |
Partially correct |
41 ms |
2264 KB |
Output is partially correct - L* = 37 |
14 |
Partially correct |
42 ms |
2312 KB |
Output is partially correct - L* = 35 |
15 |
Partially correct |
43 ms |
2228 KB |
Output is partially correct - L* = 36 |
16 |
Partially correct |
43 ms |
2252 KB |
Output is partially correct - L* = 34 |
17 |
Partially correct |
42 ms |
2200 KB |
Output is partially correct - L* = 37 |
18 |
Partially correct |
44 ms |
2232 KB |
Output is partially correct - L* = 35 |
19 |
Partially correct |
42 ms |
2232 KB |
Output is partially correct - L* = 36 |
20 |
Partially correct |
41 ms |
2232 KB |
Output is partially correct - L* = 36 |
21 |
Partially correct |
42 ms |
2340 KB |
Output is partially correct - L* = 36 |
22 |
Partially correct |
42 ms |
2264 KB |
Output is partially correct - L* = 28 |
23 |
Partially correct |
42 ms |
2236 KB |
Output is partially correct - L* = 35 |
24 |
Partially correct |
41 ms |
2292 KB |
Output is partially correct - L* = 35 |
25 |
Partially correct |
42 ms |
2276 KB |
Output is partially correct - L* = 34 |
26 |
Partially correct |
42 ms |
2288 KB |
Output is partially correct - L* = 35 |
27 |
Partially correct |
41 ms |
2288 KB |
Output is partially correct - L* = 37 |
28 |
Partially correct |
43 ms |
2236 KB |
Output is partially correct - L* = 35 |
29 |
Partially correct |
42 ms |
2264 KB |
Output is partially correct - L* = 35 |
30 |
Partially correct |
42 ms |
2376 KB |
Output is partially correct - L* = 34 |
31 |
Partially correct |
42 ms |
2200 KB |
Output is partially correct - L* = 36 |
32 |
Partially correct |
42 ms |
2348 KB |
Output is partially correct - L* = 35 |
33 |
Partially correct |
41 ms |
2208 KB |
Output is partially correct - L* = 35 |
34 |
Partially correct |
43 ms |
2248 KB |
Output is partially correct - L* = 35 |
35 |
Partially correct |
42 ms |
2232 KB |
Output is partially correct - L* = 35 |
36 |
Partially correct |
42 ms |
2240 KB |
Output is partially correct - L* = 34 |
37 |
Partially correct |
41 ms |
2296 KB |
Output is partially correct - L* = 34 |
38 |
Partially correct |
41 ms |
2336 KB |
Output is partially correct - L* = 35 |
39 |
Partially correct |
42 ms |
2276 KB |
Output is partially correct - L* = 35 |
40 |
Partially correct |
41 ms |
2244 KB |
Output is partially correct - L* = 34 |