Submission #1074123

# Submission time Handle Problem Language Result Execution time Memory
1074123 2024-08-25T08:10:20 Z deera Wombats (IOI13_wombats) C++14
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;

const int M = 5000;
const int N = 200;

int R, C;
int H[M][N], V[M][N];
int sum = 0;

void init(int _R, int _C, int _H[5000][200], int _V[5000][200]) {
    R = _R;
    C = _C;

    for (int i = 0; i < R; i++)
        for (int j = 0; j < C - 1; j++)
            H[i][j] = _H[i][j], sum += H[i][j];

    for (int i = 0; i < R - 1; i++)
        for (int j = 0; j < C; j++)
            V[i][j] = _V[i][j], sum += V[i][j];
}

void changeH(int P, int Q, int W) {
    sum += W - H[P][Q];
    H[P][Q] = W;
}

void changeV(int P, int Q, int W) {
    sum += W - V[P][Q];
    V[P][Q] = W;
}

int escape(int V1, int V2) {
    return sum;
}

Compilation message

grader.c: In function 'int main()':
grader.c:15:6: warning: variable 'res' set but not used [-Wunused-but-set-variable]
   15 |  int res;
      |      ^~~
/usr/bin/ld: /tmp/ccSKhhdN.o: in function `main':
grader.c:(.text.startup+0x129): undefined reference to `init'
/usr/bin/ld: grader.c:(.text.startup+0x194): undefined reference to `escape'
/usr/bin/ld: grader.c:(.text.startup+0x203): undefined reference to `changeH'
/usr/bin/ld: grader.c:(.text.startup+0x26d): undefined reference to `changeV'
collect2: error: ld returned 1 exit status