제출 #958635

#제출 시각아이디문제언어결과실행 시간메모리
958635Tyx2019앵무새 (IOI11_parrots)C++17
0 / 100
1 ms1316 KiB
#include "encoder.h" #include "encoderlib.h" #include <iostream> void encode(int N, int M[]) { int len = 0; for(int i=0;i<N;i++){ int a = M[i]; for(int k=0;k<8;k++){ int b = a % 2; a /= 2; for(int j = 0;j < b;j++){ len++; send(i * 4 + k); //std::cout << i * 8 + k << " "; } } } //std::cout << "LEN IS " << len << '\n'; }
#include "decoder.h" #include "decoderlib.h" #include <bits/stdc++.h> using namespace std; void decode(int N, int L, int X[]) { int cnt[8 * N]; memset(cnt, 0, sizeof(cnt)); for(int i=0;i<L;i++){ cnt[X[i]]++; } int M[N]; int grr[] = {1, 2, 4, 8, 16, 32, 64, 128}; for(int i=0;i<N;i++){ M[i] = 0; for(int j=8*i;j<8*i+8;j++){ M[i] += cnt[j] * (grr[j - 8*i]); } output(M[i]); //cout << M[i] << " "; } }
#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...