# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1051628 | user736482 | Parrots (IOI11_parrots) | C++17 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
#include "decoder.h"
#include "decoderlib.h"
#include "encoder.h"
#include "encoderlib.h"
using namespace std;
void encode(int n,vector<int>v){
int k=0;
for(int i=0;i<n;i++){
k*=2;
k+=v[i];
}
//cout<<k;
send(k);
}
/*int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
encode(8,{0,1,1,0,1,0,0,1});
decode(8,1,{105});
return 0;
}*/
#include<bits/stdc++.h>
#include "decoder.h"
#include "decoderlib.h"
#include "encoder.h"
#include "encoderlib.h"
using namespace std;
void decode(int n,int l,vector<int>v){
for(int i=n-1;i>=0;i--){
//cout<<(1<<i);
if(v[0]&(1<<i))
//cout<<1<<" ";
output(1);
else
//cout<<0<<" ";
output(0);
}
}
/*int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
encode(8,{0,1,1,0,1,0,0,1});
decode(8,1,{105});
return 0;
}*/