#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;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
512 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |