Submission #1104479

#TimeUsernameProblemLanguageResultExecution timeMemory
1104479M_W_13Parrots (IOI11_parrots)C++17
Compilation error
0 ms0 KiB
#include "encoder.h"
#include "encoderlib.h"
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (n); i++)
int dp[11][5];

void preprocess() {
    rep(j, 4) {
        dp[10][j] = 4 - j;
    }
    for (int i = 9; i >= 1; i--) {
        rep(j, 4){
            dp[i][j] = 0;
            for (int c = j; c < 4; c++) {
                dp[i][j] += dp[i + 1][c];
            }
            // cout << "i = " << i << " j = " << j << " dp = " << dp[i][j] << '\n';
        }
    }
    rep(i, 11) {
        dp[i][4] = 0;
    }
    // cout << "KON" << endl;
}


void encode(int n, int T[])
{
    preprocess();
    rep(i, n) {
        int pot = 1 << 6;
        int it = 1;
        while (it <= 10) {
            int c = 3;
            while (dp[it][c] <= T[i]) {
                c--;
            }
            // cout << "c = " << c << " x = " << i + pot * c << endl;
            T[i] -= dp[it][c + 1];
            send(i + pot * c);
            it++;
        }
        // cout << "WTH" << endl;
    }
}

Compilation message (stderr)

/usr/bin/ld: /tmp/cceHXCBc.o: in function `main':
grader_decoder.cpp:(.text.startup+0x1ef): undefined reference to `decode(int, int, int*)'
collect2: error: ld returned 1 exit status