This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "bits/stdc++.h"
#include "game.h"
using namespace std;
vector<vector<long long>> grid;
vector<long long> em;
int r, c;
long long gcd2(long long a, long long b)
{
if(b==0)
return a;
return gcd2(b, a%b);
}
void init(int R, int C)
{
r = R;
c = C;
em.assign(c, 0);
grid.assign(r, em);
}
void update(int P, int Q, long long K)
{
grid[P][Q] = K;
}
long long calculate(int P, int Q, int U, int V)
{
long long res = grid[P][Q];
for(int i = P; i<=U; i++)
{
for(int j = Q; j<=V; j++)
{
res = gcd2(res, grid[i][j]);
}
}
return res;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |