제출 #412341

#제출 시각아이디문제언어결과실행 시간메모리
412341A_D앵무새 (IOI11_parrots)C++14
52 / 100
9 ms1020 KiB
#include "encoder.h" #include "encoderlib.h" #include <bits/stdc++.h> using namespace std; string con(int x) { string ret; while(x){ ret+=(x%2)+'0'; x/=2; } while(ret.size()<8)ret+='0'; return ret; } void encode(int N, int M[]) { int cnt=-1; for(int j=0;j<N;j++){ int x=M[j]; string s=con(x); for(int i=1;i<=4;i++){ cnt++; int v=cnt; char u=s.back(); s.pop_back(); int x=u-'0'; u=s.back(); s.pop_back(); int y=u-'0'; if(j==N-1&&i==4){ } x*=2; x+=y; v=x+v*4; send(v); } } }
#include "decoder.h" #include "decoderlib.h" #include <bits/stdc++.h> using namespace std; void decode(int N, int L, int X[]) { sort(X,X+L); int add=0; int mx=0; for(int i=0;i<L;i++){ mx=max(mx,X[i]); int u=X[i]; if(i%4==0&&i!=0){ output(add); add=0; } u%=4; add*=4; add+=u; } // cout<<mx<<endl; output(add); }
#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...