Submission #922279

#TimeUsernameProblemLanguageResultExecution timeMemory
922279kimParrots (IOI11_parrots)C++17
81 / 100
5 ms1704 KiB
#include "encoder.h" #include "encoderlib.h" #include<bits/stdc++.h> using namespace std; void encode(int N, int M[]) { for(int i=0;i<N;++i){ vector<int> vec(9,i); int x=M[i]; for(int j=x/100-1, mask=1<<7 ;j>=0;--j,x-=100) vec[j]+=mask; for(int j=x/10-1, mask=1<<6 ;j>=0;--j,x-=10) vec[j]+=mask; for(int j=x-1, mask=1<<5 ;j>=0;--j,x-=1) vec[j]+=mask; for(auto &e:vec) send(e); } }
#include "decoder.h" #include "decoderlib.h" #include<bits/stdc++.h> using namespace std; void decode(int N, int L, int X[]) { vector<int> ans(N); for(int i=0;i<L;++i){ int id=0; for(int mask=1<<4;mask>=1;mask>>=1) id+=(mask&X[i])?mask:0; for(int mask=1<<5,j=1;j<=100;j*=10,mask<<=1) ans[id]+=(mask&X[i])?j:0; } for(auto &e:ans) output(e); }
#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...