Submission #915078

# Submission time Handle Problem Language Result Execution time Memory
915078 2024-01-23T10:01:00 Z quanlt206 Parrots (IOI11_parrots) C++17
Compilation error
0 ms 0 KB
#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<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 encode(int, int*)':
encoder.cpp:35:5: error: 'send' was not declared in this scope
   35 |     send(res);
      |     ^~~~
encoder.cpp: In function 'void decode(int, int, int*)':
encoder.cpp:40:9: error: 'output' was not declared in this scope
   40 |         output((x[0] >> i) & 1);
      |         ^~~~~~

decoder.cpp: In function 'void encode(int, int*)':
decoder.cpp:35:5: error: 'send' was not declared in this scope
   35 |     send(res);
      |     ^~~~
decoder.cpp: In function 'void decode(int, int, int*)':
decoder.cpp:40:9: error: 'output' was not declared in this scope
   40 |         output((x[0] >> i) & 1);
      |         ^~~~~~