제출 #24728

#제출 시각아이디문제언어결과실행 시간메모리
24728mohammad_kilani앵무새 (IOI11_parrots)C++14
52 / 100
6 ms2272 KiB
#include "encoder.h" #include "encoderlib.h" #include <bits/stdc++.h> using namespace std; void encode(int N, int M[]) { int n = 8; for(int i=0;i<N;i++){ int idx = i*n + M[i] % n; send(idx); } for(int i=0;i<N;i++){ int num = M[i] / n ; int idx = i*n + N*n ; int all = 0; for(int j=0;j<2;j++){ int cur = ((num >> j) & 1); all |= (cur << j); } idx+=all; num = (num >> 2); for(int j=0;j<=num;j++) send(idx); } }
#include "decoder.h" #include "decoderlib.h" #include <bits/stdc++.h> using namespace std; void decode(int N, int L, int X[]) { int n = 8; vector<int> mod(N); vector<int> mul(N); vector<int> frq(N); for(int i=0;i<L;i++){ if(X[i] >= n*N){ int cur = X[i] - n*N; int idx = cur / n ; int b = cur % n; mul[idx] = b; frq[idx]++; } else{ int idx = X[i] / n ; int b = X[i] % n; mod[idx] = b; } } for(int i=0;i<N;i++){ frq[i]--; frq[i] = (frq[i] << 2); mul[i]+=frq[i]; int ans = n * mul[i] + mod[i]; output(ans); } }
#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...