Submission #1002782

# Submission time Handle Problem Language Result Execution time Memory
1002782 2024-06-19T19:36:22 Z c2zi6 Parrots (IOI11_parrots) C++14
81 / 100
2 ms 1404 KB
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define ff first
#define ss second
#define pb push_back
#define all(a) (a).begin(), (a).end()
#define replr(i, a, b) for (int i = int(a); i <= int(b); ++i)
#define reprl(i, a, b) for (int i = int(a); i >= int(b); --i)
#define rep(i, n) for (int i = 0; i < int(n); ++i)
#define mkp(a, b) make_pair(a, b)
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<PII> VPI;
typedef vector<VI> VVI;
typedef vector<VVI> VVVI;
typedef vector<VPI> VVPI;
typedef pair<ll, ll> PLL;
typedef vector<ll> VL;
typedef vector<PLL> VPL;
typedef vector<VL> VVL;
typedef vector<VVL> VVVL;
typedef vector<VPL> VVPL;
template<class T> T setmax(T& a, T b) {if (a < b) return a = b; return a;}
template<class T> T setmin(T& a, T b) {if (a < b) return a; return a = b;}
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
template<class T>
using indset = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#include "encoder.h"
#include "encoderlib.h"

namespace encoder {
    int shm(int x) {
        return (1<<x)-1;
    }
};
using namespace encoder;

void encode(int N, int M[]) {
    int n = N;
    VI a;
    rep(i, n) a.pb(M[i]);

    rep(i, n) {
        rep(j, 8) {
            if (a[i] & (1<<j)) send(8*i + j);
        }
    }
}

/*send*/
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define ff first
#define ss second
#define pb push_back
#define all(a) (a).begin(), (a).end()
#define replr(i, a, b) for (int i = int(a); i <= int(b); ++i)
#define reprl(i, a, b) for (int i = int(a); i >= int(b); --i)
#define rep(i, n) for (int i = 0; i < int(n); ++i)
#define mkp(a, b) make_pair(a, b)
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<PII> VPI;
typedef vector<VI> VVI;
typedef vector<VVI> VVVI;
typedef vector<VPI> VVPI;
typedef pair<ll, ll> PLL;
typedef vector<ll> VL;
typedef vector<PLL> VPL;
typedef vector<VL> VVL;
typedef vector<VVL> VVVL;
typedef vector<VPL> VVPL;
template<class T> T setmax(T& a, T b) {if (a < b) return a = b; return a;}
template<class T> T setmin(T& a, T b) {if (a < b) return a; return a = b;}
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
template<class T>
using indset = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#include "decoder.h"
#include "decoderlib.h"

namespace decoder {
    int shm(int x) {
        return (1<<x)-1;
    }
};
using namespace decoder;

void decode(int N, int L, int X[]) {
    int n = N;
    VI a;
    rep(i, L) a.pb(X[i]);

    VI ret(n);
    for (int x : a) {
        ret[x/8] += 1<<(x%8);
    }
    for (int x : ret) output(x);
}

/*output*/
# Verdict Execution time Memory Grader output
1 Correct 0 ms 800 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 1308 KB Output is correct
2 Correct 1 ms 1312 KB Output is correct
3 Correct 1 ms 1308 KB Output is correct
4 Correct 1 ms 1316 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 1308 KB Output is correct
2 Correct 1 ms 1320 KB Output is correct
3 Correct 1 ms 1320 KB Output is correct
4 Correct 1 ms 1320 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 1316 KB Output is correct
2 Correct 1 ms 1168 KB Output is correct
3 Correct 1 ms 1320 KB Output is correct
4 Correct 1 ms 1340 KB Output is correct
5 Correct 1 ms 1340 KB Output is correct
6 Correct 2 ms 1404 KB Output is correct
# Verdict Execution time Memory Grader output
1 Partially correct 1 ms 1320 KB partially correct P=8.000000
2 Partially correct 2 ms 1344 KB partially correct P=8.000000
3 Incorrect 0 ms 804 KB Error : Bad encoded integer
4 Halted 0 ms 0 KB -