Submission #1002706

# Submission time Handle Problem Language Result Execution time Memory
1002706 2024-06-19T18:28:33 Z c2zi6 Parrots (IOI11_parrots) C++14
52 / 100
1 ms 1320 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) {
        send((a[i]>>4) + (i<<4));
        send((a[i]>>4) + (i<<4));
        send((a[i]&shm(4)) + (i<<4));
    }
}

/*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]);
    VVI ret(n);
    for (int x : a) {
        ret[x>>4].pb(x & shm(4));
    }
    for (VI vec : ret) {
        int a = vec[0];
        int b = vec[1];
        int c = vec[2];
        if (a == b) output((a<<4)+c);
        else if (a == c) output((a<<4)+b);
        else output((b<<4)+a);
    }
}

/*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 1316 KB Output is correct
2 Correct 1 ms 1316 KB Output is correct
3 Correct 1 ms 1320 KB Output is correct
4 Correct 1 ms 1312 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 1316 KB Output is correct
2 Correct 1 ms 1308 KB Output is correct
3 Correct 1 ms 1312 KB Output is correct
4 Correct 1 ms 1312 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 1316 KB Output is correct
2 Correct 1 ms 1320 KB Output is correct
3 Incorrect 1 ms 796 KB Error : Bad encoded integer
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 1312 KB Output is correct
2 Incorrect 0 ms 804 KB Error : Bad encoded integer
3 Halted 0 ms 0 KB -