Submission #1315126

#TimeUsernameProblemLanguageResultExecution timeMemory
1315126PetrixParrots (IOI11_parrots)C++20
Compilation error
0 ms0 KiB
#include "encoder.h"
#include "encoderlib.h"
#include <iostream>
#include <vector>
using namespace std;

void encode(int n,int m[]) {
    vector<int> unu,zero;
    int i,j,rasp,aux;
    for(i=0;i<n;i++){
        for(j=0;j<8;j+=2){
            rasp=0;
            if(m[i]&(1<<j)) {
                rasp|=1;
            }
            if(m[i]&(1<<(j+1))){
                rasp|=2;
            }
            aux=3-rasp;
            while(rasp){rasp--;
                unu.push_back((i*8+j)/2);
            }

            while(aux){aux--;
                zero.push_back((i*8+j)/2);
            }
        }
    }
    if(unu.size()<zero.size()){
        for(auto it:unu) {
            send(it);
        }
    }else{
        for(auto it:zero) {
            send(it);
        }
        for(i=0;i<4;i++) {
            send(255);
        }
    }
}
#include "decoder.h"
#include "decoderlib.h"
#include <vector>
#include <iostream>
using namespace std;

void decode(int n,int l,int x[]) {
    vector<int> frv(256), m(n,0);
    int i,j,poz,bit,stg=0;
    for(i=0;i<l;i++){
        frv[x[i]]++;
    }
    if(cnt[255]>=4){
        cnt[255]-=4;
        stg=1;
    }

    for(i=0;i<256;i++){
        j=2*i;poz=j/8;bit=j%8;
        if(cnt[i]&1){
            m[poz]|=(1<<bit);
        }
        if(cnt[i]&2){
            m[pos]|=(1<<(bit+1));
        }
    }
    if(stg){
        for(i=0;i<n;i++){
            for(j=0;j<8;j++){
                m[i]^=(1<<j);
            }
        }
    }
    for(auto it:m) {
        output(it);
    }
}

Compilation message (stderr)

# 2번째 컴파일 단계

decoder.cpp: In function 'void decode(int, int, int*)':
decoder.cpp:13:8: error: 'cnt' was not declared in this scope; did you mean 'int'?
   13 |     if(cnt[255]>=4){
      |        ^~~
      |        int
decoder.cpp:20:12: error: 'cnt' was not declared in this scope; did you mean 'int'?
   20 |         if(cnt[i]&1){
      |            ^~~
      |            int
decoder.cpp:23:12: error: 'cnt' was not declared in this scope; did you mean 'int'?
   23 |         if(cnt[i]&2){
      |            ^~~
      |            int
decoder.cpp:24:15: error: 'pos' was not declared in this scope; did you mean 'poz'?
   24 |             m[pos]|=(1<<(bit+1));
      |               ^~~
      |               poz