#include "Anna.h"
#include <bits/stdc++.h>
using namespace std;
namespace {
}
int Declare() {
return 2000;
}
pair<vector<int>, vector<int> > Anna(long long A) {
vector<int> x,y;
long long buc=(1<<18);
long long len=1200+A/buc,b=A%buc;
long long alr=0;
for(int i=0; i<9; i++){
//cout << ((b>>i)&1) << ' ';
for(int j=0; j<(1<<i); j++){
x.push_back((b>>i)&1);
y.push_back((b>>i)&1);
alr++;
}
}
b>>=9;
for(int i=0; i<len-alr-alr; i++){
x.push_back(0);
y.push_back(0);
}
vector<int> tx,ty;
for(int i=0; i<9; i++){
//cout << ((b>>i)&1) << ' ';
for(int j=0; j<(1<<i); j++){
tx.push_back((b>>i)&1);
ty.push_back((b>>i)&1);
}
}
//cout << '\n';
reverse(tx.begin(),tx.end());
reverse(ty.begin(),ty.end());
for(int i:tx) x.push_back(i);
for(int i:ty) y.push_back(i);
//for(int i:x) cout << i;
//cout << '\n' << '\n';
//for(int i:y) cout << i;
//cout << '\n' << '\n';
return {x,y};
}
#include "Bruno.h"
#include <bits/stdc++.h>
using namespace std;
namespace {
int variable_example = 0;
}
long long Bruno(std::vector<int> u) {
//for(int i:u) cout << i;
//cout << '\n' << '\n';
long long buc=(1<<18);
long long a=((int)u.size()-2400)/2;
long long b=0;
int t1=0,t2=0;
vector<int> bts;
for(int i=0; i<1100; i++){
if(bts.size()==9) break;
if(u[i]==0){
if(t1==0){
bts.push_back(0);
t1+=(1<<(int)bts.size())-1;
}
else t1--;
}
else{
if(t2==0){
bts.push_back(1);
t2+=(1<<(int)bts.size())-1;
}
else t2--;
}
}
t1=0; t2=0;
int cnt=0;
for(int i=(int)u.size()-1; i>=(int)u.size()-1100; i--){
if(bts.size()==18) break;
if(u[i]==0){
if(t1==0){
bts.push_back(0);
cnt++;
t1+=(1<<cnt)-1;
}
else t1--;
}
else{
if(t2==0){
bts.push_back(1);
cnt++;
t2+=(1<<(int)cnt)-1;
}
else t2--;
}
}
cnt=0;
for(int i:bts){
//cout << i << ' ';
if(i) b^=(1<<cnt);
cnt++;
}
//cout << '\n';
//cout << a << ' ' << b << ' ' << a*buc+b << '\n';
return a*buc+b;
}
# | 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... |