#include "Anna.h"
#include "bits/extc++.h"
using namespace std;
template <typename T>
void dbgh(const T& t) {
cerr << t << endl;
}
template <typename T, typename... U>
void dbgh(const T& t, const U&... u) {
cerr << t << " | ";
dbgh(u...);
}
#ifdef DEBUG
#define dbg(...) \
cerr << "L" << __LINE__ << " [" << #__VA_ARGS__ << "]" \
<< ": "; \
dbgh(__VA_ARGS__)
#else
#define cerr \
if (false) \
cerr
#define dbg(...)
#endif
using ll = long long;
#define endl "\n"
#define long int64_t
#define sz(x) int((x).size())
int Declare() {
return 180;
}
pair<vector<int>, vector<int>> Anna(ll x) {
vector<int> a;
for (int i = 0; i < 90; i++) {
a.push_back(0);
a.push_back(1);
}
vector<int> b;
for (int i = 59; i >= 0; i--) {
for (int j = 0; j < 3; j++) {
b.push_back(int((x >> i) & 1));
}
}
return {a, b};
}
#include "Anna.h"
#include "bits/extc++.h"
using namespace std;
template <typename T>
void dbgh(const T& t) {
cerr << t << endl;
}
template <typename T, typename... U>
void dbgh(const T& t, const U&... u) {
cerr << t << " | ";
dbgh(u...);
}
#ifdef DEBUG
#define dbg(...) \
cerr << "L" << __LINE__ << " [" << #__VA_ARGS__ << "]" \
<< ": "; \
dbgh(__VA_ARGS__)
#else
#define cerr \
if (false) \
cerr
#define dbg(...)
#endif
using ll = long long;
#define endl "\n"
#define long int64_t
#define sz(x) int((x).size())
ll Bruno(vector<int> arr) {
ll ans = 0;
int cur = 0, psum = 0;
for (auto& a : arr) {
psum += a * 2 - 1;
dbg(psum, a, cur);
if (psum == cur + 2) {
ans <<= 1;
ans |= 1;
cur += 3;
dbg(1);
} else if (psum == cur - 3) {
ans <<= 1;
cur -= 3;
dbg(0);
}
}
dbg(ans);
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
516 KB |
Output is correct |
2 |
Correct |
81 ms |
3344 KB |
Output is correct |
3 |
Correct |
79 ms |
3420 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
516 KB |
Output is correct |
2 |
Correct |
81 ms |
3344 KB |
Output is correct |
3 |
Correct |
79 ms |
3420 KB |
Output is correct |
4 |
Correct |
83 ms |
3428 KB |
Output is correct |
5 |
Correct |
86 ms |
3532 KB |
Output is correct |
6 |
Correct |
87 ms |
3520 KB |
Output is correct |
7 |
Correct |
81 ms |
3416 KB |
Output is correct |
8 |
Correct |
89 ms |
3492 KB |
Output is correct |
9 |
Correct |
81 ms |
3368 KB |
Output is correct |
10 |
Correct |
77 ms |
3388 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
516 KB |
Output is correct |
2 |
Correct |
81 ms |
3344 KB |
Output is correct |
3 |
Correct |
79 ms |
3420 KB |
Output is correct |
4 |
Correct |
83 ms |
3428 KB |
Output is correct |
5 |
Correct |
86 ms |
3532 KB |
Output is correct |
6 |
Correct |
87 ms |
3520 KB |
Output is correct |
7 |
Correct |
81 ms |
3416 KB |
Output is correct |
8 |
Correct |
89 ms |
3492 KB |
Output is correct |
9 |
Correct |
81 ms |
3368 KB |
Output is correct |
10 |
Correct |
77 ms |
3388 KB |
Output is correct |
11 |
Correct |
82 ms |
3592 KB |
Output is correct |
12 |
Correct |
89 ms |
3372 KB |
Output is correct |
13 |
Correct |
84 ms |
3340 KB |
Output is correct |
14 |
Correct |
84 ms |
3452 KB |
Output is correct |
15 |
Correct |
86 ms |
3404 KB |
Output is correct |
16 |
Correct |
84 ms |
3404 KB |
Output is correct |
17 |
Correct |
78 ms |
3440 KB |
Output is correct |
18 |
Correct |
84 ms |
3416 KB |
Output is correct |
19 |
Correct |
87 ms |
3592 KB |
Output is correct |
20 |
Correct |
82 ms |
3440 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
516 KB |
Output is correct |
2 |
Correct |
81 ms |
3344 KB |
Output is correct |
3 |
Correct |
79 ms |
3420 KB |
Output is correct |
4 |
Correct |
83 ms |
3428 KB |
Output is correct |
5 |
Correct |
86 ms |
3532 KB |
Output is correct |
6 |
Correct |
87 ms |
3520 KB |
Output is correct |
7 |
Correct |
81 ms |
3416 KB |
Output is correct |
8 |
Correct |
89 ms |
3492 KB |
Output is correct |
9 |
Correct |
81 ms |
3368 KB |
Output is correct |
10 |
Correct |
77 ms |
3388 KB |
Output is correct |
11 |
Correct |
82 ms |
3592 KB |
Output is correct |
12 |
Correct |
89 ms |
3372 KB |
Output is correct |
13 |
Correct |
84 ms |
3340 KB |
Output is correct |
14 |
Correct |
84 ms |
3452 KB |
Output is correct |
15 |
Correct |
86 ms |
3404 KB |
Output is correct |
16 |
Correct |
84 ms |
3404 KB |
Output is correct |
17 |
Correct |
78 ms |
3440 KB |
Output is correct |
18 |
Correct |
84 ms |
3416 KB |
Output is correct |
19 |
Correct |
87 ms |
3592 KB |
Output is correct |
20 |
Correct |
82 ms |
3440 KB |
Output is correct |
21 |
Correct |
82 ms |
3328 KB |
Output is correct |
22 |
Correct |
84 ms |
3388 KB |
Output is correct |
23 |
Correct |
84 ms |
3412 KB |
Output is correct |
24 |
Correct |
80 ms |
3332 KB |
Output is correct |
25 |
Correct |
83 ms |
3412 KB |
Output is correct |
26 |
Correct |
98 ms |
3604 KB |
Output is correct |
27 |
Correct |
84 ms |
3420 KB |
Output is correct |
28 |
Correct |
77 ms |
3464 KB |
Output is correct |
29 |
Correct |
81 ms |
3408 KB |
Output is correct |
30 |
Correct |
89 ms |
3392 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
516 KB |
Output is correct |
2 |
Correct |
81 ms |
3344 KB |
Output is correct |
3 |
Correct |
79 ms |
3420 KB |
Output is correct |
4 |
Correct |
83 ms |
3428 KB |
Output is correct |
5 |
Correct |
86 ms |
3532 KB |
Output is correct |
6 |
Correct |
87 ms |
3520 KB |
Output is correct |
7 |
Correct |
81 ms |
3416 KB |
Output is correct |
8 |
Correct |
89 ms |
3492 KB |
Output is correct |
9 |
Correct |
81 ms |
3368 KB |
Output is correct |
10 |
Correct |
77 ms |
3388 KB |
Output is correct |
11 |
Correct |
82 ms |
3592 KB |
Output is correct |
12 |
Correct |
89 ms |
3372 KB |
Output is correct |
13 |
Correct |
84 ms |
3340 KB |
Output is correct |
14 |
Correct |
84 ms |
3452 KB |
Output is correct |
15 |
Correct |
86 ms |
3404 KB |
Output is correct |
16 |
Correct |
84 ms |
3404 KB |
Output is correct |
17 |
Correct |
78 ms |
3440 KB |
Output is correct |
18 |
Correct |
84 ms |
3416 KB |
Output is correct |
19 |
Correct |
87 ms |
3592 KB |
Output is correct |
20 |
Correct |
82 ms |
3440 KB |
Output is correct |
21 |
Correct |
82 ms |
3328 KB |
Output is correct |
22 |
Correct |
84 ms |
3388 KB |
Output is correct |
23 |
Correct |
84 ms |
3412 KB |
Output is correct |
24 |
Correct |
80 ms |
3332 KB |
Output is correct |
25 |
Correct |
83 ms |
3412 KB |
Output is correct |
26 |
Correct |
98 ms |
3604 KB |
Output is correct |
27 |
Correct |
84 ms |
3420 KB |
Output is correct |
28 |
Correct |
77 ms |
3464 KB |
Output is correct |
29 |
Correct |
81 ms |
3408 KB |
Output is correct |
30 |
Correct |
89 ms |
3392 KB |
Output is correct |
31 |
Correct |
83 ms |
3348 KB |
Output is correct |
32 |
Correct |
79 ms |
3384 KB |
Output is correct |
33 |
Correct |
81 ms |
3420 KB |
Output is correct |
34 |
Correct |
81 ms |
3464 KB |
Output is correct |
35 |
Correct |
90 ms |
3316 KB |
Output is correct |
36 |
Correct |
77 ms |
3416 KB |
Output is correct |
37 |
Correct |
76 ms |
3468 KB |
Output is correct |
38 |
Correct |
78 ms |
3468 KB |
Output is correct |
39 |
Correct |
93 ms |
3328 KB |
Output is correct |
40 |
Correct |
85 ms |
3344 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Partially correct |
81 ms |
3328 KB |
Output is partially correct |
2 |
Partially correct |
78 ms |
3328 KB |
Output is partially correct |
3 |
Partially correct |
82 ms |
3456 KB |
Output is partially correct |
4 |
Partially correct |
78 ms |
3452 KB |
Output is partially correct |
5 |
Partially correct |
83 ms |
3416 KB |
Output is partially correct |
6 |
Partially correct |
82 ms |
3492 KB |
Output is partially correct |
7 |
Partially correct |
83 ms |
3328 KB |
Output is partially correct |
8 |
Partially correct |
83 ms |
3472 KB |
Output is partially correct |
9 |
Partially correct |
87 ms |
3452 KB |
Output is partially correct |
10 |
Partially correct |
83 ms |
3424 KB |
Output is partially correct |
11 |
Partially correct |
79 ms |
3416 KB |
Output is partially correct |
12 |
Partially correct |
80 ms |
3408 KB |
Output is partially correct |
13 |
Partially correct |
80 ms |
3560 KB |
Output is partially correct |
14 |
Partially correct |
82 ms |
3376 KB |
Output is partially correct |
15 |
Partially correct |
82 ms |
3336 KB |
Output is partially correct |
16 |
Partially correct |
78 ms |
3424 KB |
Output is partially correct |
17 |
Partially correct |
79 ms |
3380 KB |
Output is partially correct |
18 |
Partially correct |
90 ms |
3540 KB |
Output is partially correct |
19 |
Partially correct |
83 ms |
3396 KB |
Output is partially correct |
20 |
Partially correct |
81 ms |
3428 KB |
Output is partially correct |