#include "Anna.h"
#include <utility>
#include <vector>
#include <iostream>
using namespace std;
namespace {
int variable_example = 0;
using ll = long long;
const int bits = 60;
const int bs = 3;
}
int Declare() {
return bs * bits;
}
std::pair<std::vector<int>, std::vector<int> > Anna(long long A) {
vector<int> S, T;
for(int i = 0; i < bits*bs/2; i++)
{
S.push_back(0);
S.push_back(1);
}
ll pow2[bits];
pow2[0] = 1;
for(int e = 1; e < bits; e++)
pow2[e] = 2LL * pow2[e-1];
for(int i = 0; i < bits; i++)
{
for(int j = 0; j < bs; j++)
{
T.push_back(bool(A & pow2[i]));
}
}
for(int i = 0; i < bits*bs; i++) cerr << S[i];
cerr << '\n';
for(int i = 0; i < bits*bs; i++) cerr << T[i];
cerr << '\n';
return make_pair(S, T);
}
#include "Bruno.h"
#include <utility>
#include <vector>
#include <iostream>
using namespace std;
namespace {
int variable_example = 0;
using vi = vector<int>;
using ll = long long;
const int bits = 60;
const int bs = 3;
}
long long Bruno(vi u) {
int sm = 0;
ll res = 0;
ll cp = 1;
// cerr << "u = ";
// for(int k:u) cerr << k;
// cerr << '\n';
for(int i = 0; i < 2 * bits*bs; i++)
{
if(u[i] == 0) sm++;
else sm--;
// cerr << i << " : " << sm << '\n';
if(sm == bs)
{
cp *= 2;
sm -= bs;
// cerr << "+ detected\n";
}
else if(sm == -bs + 1)
{
res += cp;
// cerr << "adding " << cp << '\n';
cp *= 2;
sm += bs;
// cerr << "- detected\n";
}
}
// cerr << "returning " << res << '\n';
return res;
}
Compilation message
Anna.cpp:9:5: warning: '{anonymous}::variable_example' defined but not used [-Wunused-variable]
9 | int variable_example = 0;
| ^~~~~~~~~~~~~~~~
Bruno.cpp:10:5: warning: '{anonymous}::variable_example' defined but not used [-Wunused-variable]
10 | int variable_example = 0;
| ^~~~~~~~~~~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
508 KB |
Output is correct |
2 |
Correct |
516 ms |
4008 KB |
Output is correct |
3 |
Correct |
523 ms |
4140 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
508 KB |
Output is correct |
2 |
Correct |
516 ms |
4008 KB |
Output is correct |
3 |
Correct |
523 ms |
4140 KB |
Output is correct |
4 |
Correct |
513 ms |
3984 KB |
Output is correct |
5 |
Correct |
534 ms |
4052 KB |
Output is correct |
6 |
Correct |
547 ms |
4212 KB |
Output is correct |
7 |
Correct |
532 ms |
4044 KB |
Output is correct |
8 |
Correct |
523 ms |
4040 KB |
Output is correct |
9 |
Correct |
534 ms |
4036 KB |
Output is correct |
10 |
Correct |
504 ms |
4060 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
508 KB |
Output is correct |
2 |
Correct |
516 ms |
4008 KB |
Output is correct |
3 |
Correct |
523 ms |
4140 KB |
Output is correct |
4 |
Correct |
513 ms |
3984 KB |
Output is correct |
5 |
Correct |
534 ms |
4052 KB |
Output is correct |
6 |
Correct |
547 ms |
4212 KB |
Output is correct |
7 |
Correct |
532 ms |
4044 KB |
Output is correct |
8 |
Correct |
523 ms |
4040 KB |
Output is correct |
9 |
Correct |
534 ms |
4036 KB |
Output is correct |
10 |
Correct |
504 ms |
4060 KB |
Output is correct |
11 |
Correct |
554 ms |
4120 KB |
Output is correct |
12 |
Correct |
529 ms |
4048 KB |
Output is correct |
13 |
Correct |
500 ms |
4268 KB |
Output is correct |
14 |
Correct |
547 ms |
4088 KB |
Output is correct |
15 |
Correct |
526 ms |
4256 KB |
Output is correct |
16 |
Correct |
523 ms |
4224 KB |
Output is correct |
17 |
Correct |
515 ms |
3984 KB |
Output is correct |
18 |
Correct |
511 ms |
4060 KB |
Output is correct |
19 |
Correct |
542 ms |
4180 KB |
Output is correct |
20 |
Correct |
520 ms |
4312 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
508 KB |
Output is correct |
2 |
Correct |
516 ms |
4008 KB |
Output is correct |
3 |
Correct |
523 ms |
4140 KB |
Output is correct |
4 |
Correct |
513 ms |
3984 KB |
Output is correct |
5 |
Correct |
534 ms |
4052 KB |
Output is correct |
6 |
Correct |
547 ms |
4212 KB |
Output is correct |
7 |
Correct |
532 ms |
4044 KB |
Output is correct |
8 |
Correct |
523 ms |
4040 KB |
Output is correct |
9 |
Correct |
534 ms |
4036 KB |
Output is correct |
10 |
Correct |
504 ms |
4060 KB |
Output is correct |
11 |
Correct |
554 ms |
4120 KB |
Output is correct |
12 |
Correct |
529 ms |
4048 KB |
Output is correct |
13 |
Correct |
500 ms |
4268 KB |
Output is correct |
14 |
Correct |
547 ms |
4088 KB |
Output is correct |
15 |
Correct |
526 ms |
4256 KB |
Output is correct |
16 |
Correct |
523 ms |
4224 KB |
Output is correct |
17 |
Correct |
515 ms |
3984 KB |
Output is correct |
18 |
Correct |
511 ms |
4060 KB |
Output is correct |
19 |
Correct |
542 ms |
4180 KB |
Output is correct |
20 |
Correct |
520 ms |
4312 KB |
Output is correct |
21 |
Correct |
522 ms |
4140 KB |
Output is correct |
22 |
Correct |
506 ms |
4560 KB |
Output is correct |
23 |
Correct |
547 ms |
4008 KB |
Output is correct |
24 |
Correct |
510 ms |
4128 KB |
Output is correct |
25 |
Correct |
550 ms |
4164 KB |
Output is correct |
26 |
Correct |
544 ms |
4360 KB |
Output is correct |
27 |
Correct |
513 ms |
4072 KB |
Output is correct |
28 |
Correct |
521 ms |
4068 KB |
Output is correct |
29 |
Correct |
584 ms |
4140 KB |
Output is correct |
30 |
Correct |
523 ms |
4044 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
508 KB |
Output is correct |
2 |
Correct |
516 ms |
4008 KB |
Output is correct |
3 |
Correct |
523 ms |
4140 KB |
Output is correct |
4 |
Correct |
513 ms |
3984 KB |
Output is correct |
5 |
Correct |
534 ms |
4052 KB |
Output is correct |
6 |
Correct |
547 ms |
4212 KB |
Output is correct |
7 |
Correct |
532 ms |
4044 KB |
Output is correct |
8 |
Correct |
523 ms |
4040 KB |
Output is correct |
9 |
Correct |
534 ms |
4036 KB |
Output is correct |
10 |
Correct |
504 ms |
4060 KB |
Output is correct |
11 |
Correct |
554 ms |
4120 KB |
Output is correct |
12 |
Correct |
529 ms |
4048 KB |
Output is correct |
13 |
Correct |
500 ms |
4268 KB |
Output is correct |
14 |
Correct |
547 ms |
4088 KB |
Output is correct |
15 |
Correct |
526 ms |
4256 KB |
Output is correct |
16 |
Correct |
523 ms |
4224 KB |
Output is correct |
17 |
Correct |
515 ms |
3984 KB |
Output is correct |
18 |
Correct |
511 ms |
4060 KB |
Output is correct |
19 |
Correct |
542 ms |
4180 KB |
Output is correct |
20 |
Correct |
520 ms |
4312 KB |
Output is correct |
21 |
Correct |
522 ms |
4140 KB |
Output is correct |
22 |
Correct |
506 ms |
4560 KB |
Output is correct |
23 |
Correct |
547 ms |
4008 KB |
Output is correct |
24 |
Correct |
510 ms |
4128 KB |
Output is correct |
25 |
Correct |
550 ms |
4164 KB |
Output is correct |
26 |
Correct |
544 ms |
4360 KB |
Output is correct |
27 |
Correct |
513 ms |
4072 KB |
Output is correct |
28 |
Correct |
521 ms |
4068 KB |
Output is correct |
29 |
Correct |
584 ms |
4140 KB |
Output is correct |
30 |
Correct |
523 ms |
4044 KB |
Output is correct |
31 |
Correct |
553 ms |
4048 KB |
Output is correct |
32 |
Correct |
522 ms |
4156 KB |
Output is correct |
33 |
Correct |
528 ms |
4152 KB |
Output is correct |
34 |
Correct |
541 ms |
4112 KB |
Output is correct |
35 |
Correct |
558 ms |
4132 KB |
Output is correct |
36 |
Correct |
532 ms |
4000 KB |
Output is correct |
37 |
Correct |
517 ms |
4012 KB |
Output is correct |
38 |
Correct |
536 ms |
4088 KB |
Output is correct |
39 |
Correct |
539 ms |
4012 KB |
Output is correct |
40 |
Correct |
540 ms |
4020 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Partially correct |
518 ms |
4148 KB |
Output is partially correct |
2 |
Partially correct |
561 ms |
4088 KB |
Output is partially correct |
3 |
Partially correct |
539 ms |
4020 KB |
Output is partially correct |
4 |
Partially correct |
538 ms |
4004 KB |
Output is partially correct |
5 |
Partially correct |
523 ms |
4024 KB |
Output is partially correct |
6 |
Partially correct |
528 ms |
4044 KB |
Output is partially correct |
7 |
Partially correct |
511 ms |
4088 KB |
Output is partially correct |
8 |
Partially correct |
515 ms |
4012 KB |
Output is partially correct |
9 |
Partially correct |
542 ms |
4072 KB |
Output is partially correct |
10 |
Partially correct |
533 ms |
4024 KB |
Output is partially correct |
11 |
Partially correct |
553 ms |
4160 KB |
Output is partially correct |
12 |
Partially correct |
513 ms |
4196 KB |
Output is partially correct |
13 |
Partially correct |
558 ms |
4012 KB |
Output is partially correct |
14 |
Partially correct |
531 ms |
4116 KB |
Output is partially correct |
15 |
Partially correct |
519 ms |
4088 KB |
Output is partially correct |
16 |
Partially correct |
526 ms |
4188 KB |
Output is partially correct |
17 |
Partially correct |
505 ms |
4036 KB |
Output is partially correct |
18 |
Partially correct |
533 ms |
4120 KB |
Output is partially correct |
19 |
Partially correct |
505 ms |
4088 KB |
Output is partially correct |
20 |
Partially correct |
507 ms |
4052 KB |
Output is partially correct |