이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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... |