Submission #1219870

#TimeUsernameProblemLanguageResultExecution timeMemory
1219870SpyrosAliv앵무새 (IOI11_parrots)C++20
Compilation error
0 ms0 KiB
#include "encoder.h"
#include "encoderlib.h"
#include "decoder.h"
#include "decoderlib.h"
#include <bits/stdc++.h>
using namespace std;

void encode(int n, int m[]) {
    int fin = 0;
    for (int i = 0; i < n; i++) {
        fin |= (1 << m[i]);
    }
    send(fin);
}

void decode(int n, int l, int x[]) {
    int fin[n];
    for (int i = 0; i < n; i++) {
        if ((x[0] >> i) & 1) fin[i] = 1;
        else fin[i] = 0;
    }
    output(fin);
}
#include "encoder.h"
#include "encoderlib.h"
#include "decoder.h"
#include "decoderlib.h"
#include <bits/stdc++.h>
using namespace std;

void encode(int n, int m[]) {
    int fin = 0;
    for (int i = 0; i < n; i++) {
        fin |= (1 << m[i]);
    }
    send(fin);
}

void decode(int n, int l, int x[]) {
    int fin[n];
    for (int i = 0; i < n; i++) {
        if ((x[0] >> i) & 1) fin[i] = 1;
        else fin[i] = 0;
    }
    output(fin);
}

Compilation message (stderr)

# 1번째 컴파일 단계

encoder.cpp: In function 'void decode(int, int, int*)':
encoder.cpp:22:12: error: invalid conversion from 'int*' to 'int' [-fpermissive]
   22 |     output(fin);
      |            ^~~
      |            |
      |            int*
In file included from encoder.cpp:4:
decoderlib.h:1:17: note:   initializing argument 1 of 'void output(int)'
    1 | void output(int b);
      |             ~~~~^