Submission #1332414

#TimeUsernameProblemLanguageResultExecution timeMemory
1332414QuocSenseiParrots (IOI11_parrots)C++20
17 / 100
1 ms836 KiB
#include <bits/stdc++.h>

#define ENCODER
// #define DECODER

#define ll long long 
#define el cout << endl
#define bit(mask, i) (((mask) >> (i)) & 1)
#define BIT(n) ((1ll) << (n))

using namespace std;

void send(int a);
void output(int b);

namespace SUBTASK_1
{
    #ifdef ENCODER
    namespace personA
    {
        void encode(int N, int M[])
        {
            int a = 0;
            for (int i = 0; i < N; i++)
                a += M[i] * BIT(i);
            send(a);
        }
    }
    #endif

    #ifdef DECODER
    namespace personB
    {
        void decode(int N, int L, int X[])
        {
            for (int i = 0; i < N; i++)
                output(bit(X[0], i));
        }
    }
    #endif
}

#ifdef ENCODER
void encode(int N, int M[])
{
    SUBTASK_1::personA::encode(N, M);
}
#endif
#ifdef DECODER
void decode(int N, int L, int X[])
{
    SUBTASK_1::personB::decode(N, L, X);
}
#endif
#include <bits/stdc++.h>

// #define ENCODER
#define DECODER

#define ll long long 
#define el cout << endl
#define bit(mask, i) (((mask) >> (i)) & 1)
#define BIT(n) ((1ll) << (n))

using namespace std;

void send(int a);
void output(int b);

namespace SUBTASK_1
{
    #ifdef ENCODER
    namespace personA
    {
        void encode(int N, int M[])
        {
            int a = 0;
            for (int i = 0; i < N; i++)
                a += M[i] * BIT(i);
            send(a);
        }
    }
    #endif

    #ifdef DECODER
    namespace personB
    {
        void decode(int N, int L, int X[])
        {
            for (int i = 0; i < N; i++)
                output(bit(X[0], i));
        }
    }
    #endif
}

#ifdef ENCODER
void encode(int N, int M[])
{
    SUBTASK_1::personA::encode(N, M);
}
#endif
#ifdef DECODER
void decode(int N, int L, int X[])
{
    SUBTASK_1::personB::decode(N, L, X);
}
#endif
#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...