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 "game.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll gcd2(ll X, ll Y)
{
ll tmp;
while (X != Y && Y != 0)
{
tmp = X;
X = Y;
Y = tmp % Y;
}
return X;
}
vector<vector<ll> > v;
ll i, j, an;
void init(int R, int C)
{
v.resize(R);
for (i = 0; i < R; i++)
{
v[i].resize(C);
for (j = 0; j < C; j++)
v[i][j] = 0;
}
}
void update(int P, int Q, ll K)
{
v[P][Q] = K;
}
ll calculate(int P, int Q, int U, int V)
{
an = 0;
for (i = P; i <= U; i++)
{
for (j = Q; j <= V; j++)
an = gcd2(an, v[i][j]);
}
return an;
}
# | 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... |