제출 #881657

#제출 시각아이디문제언어결과실행 시간메모리
881657karrigan앵무새 (IOI11_parrots)C++14
81 / 100
3 ms1596 KiB
#include<bits/stdc++.h> #include "encoder.h" #include "encoderlib.h" using namespace std; #define all(fl) fl.begin(),fl.end() #define pb push_back #define fi first #define se second #define for1(i,j,k) for(int i=j;i<=k;i++) #define for2(i,j,k) for(int i=j;i>=k;i--) #define for3(i,j,k,l) for(int i=j;i<=k;i+=l) #define lb lower_bound #define ub upper_bound #define sz(a) (int)a.size() #define pii pair<int,int> #define pli pair<long long,int> #define gcd __gcd #define lcm(x,y) x*y/__gcd(x,y) //5 bit dau danh so vi tri 3 bit sau bieu dien bit bat trong gia tri void encode(int n,int M[]){ for1(i,0,n-1){ int value=M[i]; int pos=(i)*(1<<3); for1(j,0,7){ if ((value>>j&1)){ send(pos+j); } } } } /*signed main(){ ios_base::sync_with_stdio(0); cin.tie(0); //freopen("temp.INP","r",stdin); //freopen("temp.OUT","w",stdout); encode(3,{10,30,20}); }*/
#include<bits/stdc++.h> #include "decoder.h" #include "decoderlib.h" using namespace std; #define all(fl) fl.begin(),fl.end() #define pb push_back #define fi first #define se second #define for1(i,j,k) for(int i=j;i<=k;i++) #define for2(i,j,k) for(int i=j;i>=k;i--) #define for3(i,j,k,l) for(int i=j;i<=k;i+=l) #define lb lower_bound #define ub upper_bound #define sz(a) (int)a.size() #define pii pair<int,int> #define pli pair<long long,int> #define gcd __gcd #define lcm(x,y) x*y/__gcd(x,y) int b[32]; void decode(int n,int l,int x[]){ for1(i,0,n-1)b[i]=0; for1(i,0,l-1){ int vl=x[i]; int pos=(vl>>3); int last=vl%(1<<3); b[pos]+=(1<<(last)); } for1(i,0,n-1)output(b[i]); } /*signed main(){ ios_base::sync_with_stdio(0); cin.tie(0); //freopen("temp.INP","r",stdin); //freopen("temp.OUT","w",stdout); encode(3,{10,30,20}); }*/
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...