Submission #1259657

#TimeUsernameProblemLanguageResultExecution timeMemory
1259657comgaTramAnh게임 (IOI13_game)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
//#include "game.h"

long long gcd2(long long X, long long Y) {
    long long tmp;
    while (X != Y && Y != 0) {
        tmp = X;
        X = Y;
        Y = tmp % Y;
    }
    return X;
}
long long a[105][105]; 

void init(int R, int C) {
  for (int i = 0; i < R; i++) {
    for (int j = 0; j < C; j++) {
      a[i][j] = 0; 
    }
  }  
}

void update(int P, int Q, long long K) {
  a[P][Q] = K; 
}

long long calculate(int P, int Q, int U, int V) {
    long long  ans = a[P][Q]; 
    for (int i = P; i <= U; i++) {
      for (int j = Q; j <= V; j++) {
        ans = gcd2(ans, a[i][j]); 
      }
    }
    return ans;
}

Compilation message (stderr)

/usr/bin/ld: /tmp/ccgBUa4v.o: in function `main':
grader.c:(.text.startup+0x6a): undefined reference to `init'
/usr/bin/ld: grader.c:(.text.startup+0xcc): undefined reference to `calculate'
/usr/bin/ld: grader.c:(.text.startup+0x136): undefined reference to `update'
collect2: error: ld returned 1 exit status