Submission #461188

# Submission time Handle Problem Language Result Execution time Memory
461188 2021-08-09T13:45:19 Z fskarica Question (Grader is different from the original contest) (CEOI14_question_grader) C++14
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>

using namespace std;

#define ll long long
#define ld long double
#define fi first
#define se second
#define pii pair<int, int>

int mat1[1000][20];
int mat2[1000][1000];

int bit(int mask) {
    int ret = 0;

    for (int i = 0; i < 12; i++) {
		if (mask & (1 << i)) ret++;
    }

    return ret;
}

int encoder(int n, int x, int y) {
    int pos = 1;
    for (int i = 1; i <= (1 << 12); i++) {
        if (bit(i) != 6) continue;

		for (int j = 0; j < 12; j++) {
			if (i & (1 << j)) {
				mat1[pos][j] = 1;
			}
			else {
				mat1[pos][j] = 0;
			}
		}

        pos++;
    }

    for (int i = 0; i < 1000; i++) {
        for (int j = 0; j < 1000; j++) {
            if (i == j) continue;

            for (int k = 0; k < 12; k++) {
                if (!mat1[i][k] && mat1[j][k]) {
                    mat2[i][j] = k;
                }
            }
        }
    }

    return mat2[x][y];
}
#include <bits/stdc++.h>

using namespace std;

#define ll long long
#define ld long double
#define fi first
#define se second
#define pii pair<int, int>

int mat1[1000][20];

int bit(int mask) {
    int ret = 0;

    for (int i = 0; i < 12; i++) {
		if (mask & (1 << i)) ret++;
    }

    return ret;
}

int decoder(int n, int q, int h) {
    int pos = 1;
    for (int i = 1; i <= (1 << 12); i++) {
        if (bit(i) != 6) continue;

		for (int j = 0; j < 12; j++) {
			if (i & (1 << j)) {
				mat1[pos][j] = 1;
			}
			else {
				mat1[pos][j] = 0;
			}
		}

        pos++;
    }

    return mat1[q][h];
}

Compilation message

/usr/bin/ld: /tmp/ccHt16ps.o: in function `main':
grader_encode.c:(.text.startup+0x129): undefined reference to `encode(int, int, int)'
collect2: error: ld returned 1 exit status

/usr/bin/ld: /tmp/ccYyIsXg.o: in function `main':
grader_decode.c:(.text.startup+0x22f): undefined reference to `decode(int, int, int)'
collect2: error: ld returned 1 exit status