#include "Anna.h"
#include <bits/stdc++.h>
using namespace std;
const int LG = 60;
int Declare(){
return LG * 3;
}
pair <vector <int>, vector <int>> Anna(long long A){
vector <int> s;
for (int i = 0; i < LG; ++ i)
for (int loops : {0, 1, 2})
s.push_back((A >> i) & 1ll);
vector <int> t;
for (int i = 0, cur = 0; i < LG * 3; ++ i)
t.push_back(cur ^= 1);
return make_pair(s, t);
}
#include "Bruno.h"
#include <bits/stdc++.h>
using namespace std;
const int LG = 60;
long long Bruno(vector <int> u){
vector <int> bit;
int f = 0, g = 0;
for (int v : u){
if (v) f ++;
else f --;
if (f >= g + 3){
bit.push_back(1);
g += 3;
}
if (f <= g - 2){
bit.push_back(0);
g -= 3;
}
}
long long ans = 0;
for (int i = 0; i < LG; ++ i)
if (bit[i]) ans |= (1ll << i);
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |