# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
240690 |
2020-06-20T17:21:34 Z |
aryan12 |
Game (IOI13_game) |
C++17 |
|
0 ms |
0 KB |
#include <bits/stdc++.h>
#include "game.h"
using namespace std;
long long gcd(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[102][102];
void update(long long row, long long col, long long val) {
a[row][col] = val;
}
long long calculate(long long r1, long long c1, long long r2, long long c2) {
long long ans = 0;
for(long long i = r1; i <= r2; i++) {
for(long long j = c1; j <= c2; j++) {
ans = gcd(ans, a[i][j]);
}
}
return ans;
}
void init(long long R, long long C) {
for(long long i = 0; i <= R; i++) {
for(long long j = 0; j <= C; j++) {
a[i][j] = 0;
}
}
}
Compilation message
grader.c: In function 'int main()':
grader.c:18:6: warning: variable 'res' set but not used [-Wunused-but-set-variable]
int res;
^~~
/tmp/ccNjdnUC.o: In function `main':
grader.c:(.text.startup+0x5d): undefined reference to `init'
grader.c:(.text.startup+0xb8): undefined reference to `calculate'
grader.c:(.text.startup+0x122): undefined reference to `update'
collect2: error: ld returned 1 exit status