Submission #1039443

#TimeUsernameProblemLanguageResultExecution timeMemory
1039443ArthuroWichGame (IOI13_game)C++17
Compilation error
0 ms0 KiB
#include "game.h" #include <bits/stdc++.h> using namespace std; #define int long long int int gcd2(int X, int Y) { int tmp; while (X != Y && Y != 0) { tmp = X; X = Y; Y = tmp % Y; } return X; } int seg[100][4*100005]; void update(int n, int l, int r, int i, int v, int id) { if (l == r) { seg[id][n] = v; } else { int m = (l+r)/2; if (l <= i && i <= m) { update(2*n, l, m, i, v, id); } else { update(2*n+1, m+1, r, i, v, id); } seg[id][n] = gcd2(seg[id][2*n], seg[id][2*n+1]); } } int query(int n, int l, int r, int a, int b, int id) { if (b < l || r < a) { return 0; } else if (a <= l && r <= b) { return seg[id][n]; } else { int m = (l+r)/2; return gcd2(query(2*n, l, m, a, b, id), query(2*n+1, m+1, r, a, b, id)); } } void init(int R, int C) { } void update(int P, int Q, int K) { update(1, 0, 100000, Q, K, P); } int calculate(int P, int Q, int U, int V) { int x = 0; for (int i = P; i <= U; i++) { x = gcd2(x, query(1, 0, 100000, Q, V, i)); } return x; }

Compilation message (stderr)

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