답안 #915079

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
915079 2024-01-23T10:01:59 Z quanlt206 앵무새 (IOI11_parrots) C++17
컴파일 오류
0 ms 0 KB
#include "encoder.h"
#include "encoderlib.h"
#include<bits/stdc++.h>
#define X first
#define Y second
#define FOR(i, a, b) for (int i = (a); i <= (b); i++)
#define REP(i, a, b) for (int i = (a); i < (b); i++)
#define FORD(i, b, a) for (int i = (b); i >= (a); i--)
#define all(x) begin(x), end(x)
#define MASK(x) (1LL << (x))
#define SQR(x) (1LL * (x) * (x))

using namespace std;

typedef long long ll;
typedef long double ld;
typedef double db;
typedef pair<int, int> pii;
typedef pair<int, pii> piii;
typedef pair<ll, ll> pll;
typedef pair<ll, pll> plll;
typedef pair<ll, int> pli;

template<class A, class B>
    bool maximize(A& x, B y) {
        if (x < y) return x = y, true; else return false;
    }
template<class A, class B>
    bool minimize(A& x, B y) {
        if (x > y) return x = y, true; else return false;
    }
/* END OF TEMPLATE */

void encode(int n, int m[]) {
    int res = 0;
    REP(i, 0, n) res = res + MASK(i) * m[i];
    send(res);
}

void decode(int n, int L, int x[]) {
    REP(i, 0, n) {
        output((x[0] >> i) & 1);
    }
}
#include "decoder.h"
#include "decoderlib.h"
#include<bits/stdc++.h>
#define X first
#define Y second
#define FOR(i, a, b) for (int i = (a); i <= (b); i++)
#define REP(i, a, b) for (int i = (a); i < (b); i++)
#define FORD(i, b, a) for (int i = (b); i >= (a); i--)
#define all(x) begin(x), end(x)
#define MASK(x) (1LL << (x))
#define SQR(x) (1LL * (x) * (x))

using namespace std;

typedef long long ll;
typedef long double ld;
typedef double db;
typedef pair<int, int> pii;
typedef pair<int, pii> piii;
typedef pair<ll, ll> pll;
typedef pair<ll, pll> plll;
typedef pair<ll, int> pli;

template<class A, class B>
    bool maximize(A& x, B y) {
        if (x < y) return x = y, true; else return false;
    }
template<class A, class B>
    bool minimize(A& x, B y) {
        if (x > y) return x = y, true; else return false;
    }
/* END OF TEMPLATE */

void encode(int n, int m[]) {
    int res = 0;
    REP(i, 0, n) res = res + MASK(i) * m[i];
    send(res);
}

void decode(int n, int L, int x[]) {
    REP(i, 0, n) {
        output((x[0] >> i) & 1);
    }
}

Compilation message

encoder.cpp: In function 'void decode(int, int, int*)':
encoder.cpp:42:9: error: 'output' was not declared in this scope
   42 |         output((x[0] >> i) & 1);
      |         ^~~~~~

decoder.cpp: In function 'void encode(int, int*)':
decoder.cpp:37:5: error: 'send' was not declared in this scope
   37 |     send(res);
      |     ^~~~