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;
int r,c;
long long a[128][128];
void init(int R,int C)
{
r=R;
c=C;
}
void update(int x,int y,long long v)
{
a[x][y]=v;
}
long long calculate(int p,int q,int u,int v)
{
long long ans=-1;
for(int i=p;i<=u;i++)
{
for(int j=q;j<=v;j++)
{
if(a[i][j]!=0)
{
if(ans==-1)ans=a[i][j];
else ans=__gcd(ans,a[i][j]);
}
}
}
return ans;
}
# | 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... |