Submission #204005

# Submission time Handle Problem Language Result Execution time Memory
204005 2020-02-23T15:16:52 Z dung11112003 Parrots (IOI11_parrots) C++11
81 / 100
14 ms 2040 KB
#include "encoder.h"
#include "encoderlib.h"
#include <bits/stdc++.h>

#define taskname ""
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define for0(i, n) for (int i = 0; i < (int)(n); ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define ford(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define fore(i, a, b) for (int i = (int)(a); i <= (int)(b); ++i)

using namespace std;

typedef long long ll;
typedef long double ld;
typedef complex <ld> cd;
typedef vector <cd> vcd;
typedef vector <int> vi;

template<class T> using v2d = vector <vector <T> >;
template<class T> bool uin(T &a, T b)
{
    return a > b ? (a = b, true) : false;
}
template<class T> bool uax(T &a, T b)
{
    return a < b ? (a = b, true) : false;
}

static mt19937 rng(chrono::system_clock::now().time_since_epoch().count());

void encode(int N, int M[])
{
    int n = N;
    int *a = M;
    bool bt[1 << 8] = {0};
    for0(i, n)
    {
        for0(j, 8)
        {
            bt[i * 8 + j] = (a[i] >> j & 1);
        }
    }
    for0(i, n * 8)
    {
        if (bt[i])
        {
            send(i);
        }
    }
}
#include "decoder.h"
#include "decoderlib.h"
#include <bits/stdc++.h>

#define taskname ""
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define for0(i, n) for (int i = 0; i < (int)(n); ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define ford(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define fore(i, a, b) for (int i = (int)(a); i <= (int)(b); ++i)

using namespace std;

typedef long long ll;
typedef long double ld;
typedef complex <ld> cd;
typedef vector <cd> vcd;
typedef vector <int> vi;

template<class T> using v2d = vector <vector <T> >;
template<class T> bool uin(T &a, T b)
{
    return a > b ? (a = b, true) : false;
}
template<class T> bool uax(T &a, T b)
{
    return a < b ? (a = b, true) : false;
}

static mt19937 rng(chrono::system_clock::now().time_since_epoch().count());

void decode(int N, int L, int X[])
{
    int n = N, m = L;
    int *pos = X;
    bool bt[1 << 8] = {0};
    for0(i, m)
    {
        bt[pos[i]] = 1;
    }
    for0(i, n)
    {
        int a = 0;
        for0(j, 8)
        {
            a |= bt[i * 8 + j] << j;
        }
        output(a);
    }
}
# Verdict Execution time Memory Grader output
1 Correct 10 ms 916 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 10 ms 1520 KB Output is correct
2 Correct 10 ms 1520 KB Output is correct
3 Correct 11 ms 1520 KB Output is correct
4 Correct 11 ms 1520 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 10 ms 1528 KB Output is correct
2 Correct 11 ms 1520 KB Output is correct
3 Correct 11 ms 1520 KB Output is correct
4 Correct 11 ms 1520 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 10 ms 1520 KB Output is correct
2 Correct 11 ms 1520 KB Output is correct
3 Correct 11 ms 1520 KB Output is correct
4 Correct 14 ms 1776 KB Output is correct
5 Correct 12 ms 1520 KB Output is correct
6 Correct 13 ms 1776 KB Output is correct
# Verdict Execution time Memory Grader output
1 Partially correct 11 ms 1520 KB Output is partially correct - P = 8.000000
2 Partially correct 13 ms 2040 KB Output is partially correct - P = 8.000000
3 Incorrect 9 ms 980 KB Error : Bad encoded integer
4 Runtime error 5 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
5 Runtime error 6 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
6 Runtime error 5 ms 632 KB Execution killed with signal 11 (could be triggered by violating memory limits)
7 Runtime error 5 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)