제출 #767016

#제출 시각아이디문제언어결과실행 시간메모리
767016raysh07앵무새 (IOI11_parrots)C++17
0 / 100
2 ms1060 KiB
#include "encoder.h"
#include "encoderlib.h"
#include <bits/stdc++.h>
using namespace std;

void encode(int n, int a[])
{
//   int i;
//   for(i=0; i<N; i++)
//     send(M[i]);
    if (n <= 32){
        for (int i = 0; i < n; i++){
            for (int j = 0; j < 8; j++){
                if (a[i] >> j & 1){
                    send(8 * i + j);
                }
            }
        }
    }
}
#include "decoder.h"
#include "decoderlib.h"
#include <bits/stdc++.h>
using namespace std;

void decode(int n, int l, int a[])
{
    //l is length of encoded sequence
    //n is the answer we need 
    int cnt[256];
    for (int i = 0; i < l; i++) cnt[a[i]]++;
    if (n <= 32){
        int ans[n];
        for (int i = 0; i < 256; i++){
            if (cnt[i] == 1){
                ans[i / 8] += 1 << (i % 8);
            }
        }
        
        for (int i = 0; i < n; i++){
            output(ans[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...