#include "game.h"
#include "grader.cpp"
#include <bits/stdc++.h>
using namespace std;
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;
}
vector < vector <int> > ar;
vector < pair <int, int> > vec;
void init(int R, int C) {
ar.resize(R);
for(int i = 0; i < R; i ++)
ar[i].resize(C + 1);
}
void update(int P, int Q, long long K) {
ar[P][Q] = K;
vec.emplace_back(P, Q);
}
long long calculate(int P, int Q, int U, int V) {
long long ans = 0;
int sz = (int)vec.size();
for(int i = 0; i < sz; i ++){
if(vec[i].first >= P && vec[i].first <= U && vec[i].second >= Q && vec[i].second <= V)
ans = gcd2(ans, ar[vec[i].first][vec[i].second]);
}
return ans;
}
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;
^~~
game.cpp:2:10: fatal error: grader.cpp: No such file or directory
#include "grader.cpp"
^~~~~~~~~~~~
compilation terminated.