#include "game.h"
//10point;
typedef long long ll;
bool flag;
ll idx[100][100];
ll gc(ll x,ll y){
ll tmp=-1;
while(x!=tmp&&y)tmp=x,x=y,y=tmp%y;
return x;
}
void init(int R, int C){
if(R>100||C>100)flag=1;
}
void update(int P, int Q, long long K){
idx[P][Q]=K;
}
long long calculate(int P, int Q, int U, int V){
if(flag)return -1;
int i,j;
ll ret=0;
for(i=P;i<=U;i++)for(j=Q;j<=V;j++)ret=gc(ret,idx[i][j]);
return ret;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
1164 KB |
Output is correct |
2 |
Correct |
0 ms |
1164 KB |
Output is correct |
3 |
Correct |
0 ms |
1164 KB |
Output is correct |
4 |
Correct |
0 ms |
1164 KB |
Output is correct |
5 |
Correct |
0 ms |
1164 KB |
Output is correct |
6 |
Correct |
0 ms |
1164 KB |
Output is correct |
7 |
Correct |
0 ms |
1164 KB |
Output is correct |
8 |
Correct |
0 ms |
1164 KB |
Output is correct |
9 |
Correct |
0 ms |
1164 KB |
Output is correct |
10 |
Correct |
0 ms |
1164 KB |
Output is correct |
11 |
Correct |
0 ms |
1164 KB |
Output is correct |
12 |
Correct |
0 ms |
1164 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
1164 KB |
Output is correct |
2 |
Correct |
0 ms |
1164 KB |
Output is correct |
3 |
Correct |
0 ms |
1164 KB |
Output is correct |
4 |
Runtime error |
0 ms |
1160 KB |
SIGSEGV Segmentation fault |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
1164 KB |
Output is correct |
2 |
Correct |
0 ms |
1164 KB |
Output is correct |
3 |
Correct |
0 ms |
1164 KB |
Output is correct |
4 |
Correct |
0 ms |
1164 KB |
Output is correct |
5 |
Correct |
0 ms |
1164 KB |
Output is correct |
6 |
Correct |
0 ms |
1164 KB |
Output is correct |
7 |
Correct |
0 ms |
1164 KB |
Output is correct |
8 |
Correct |
0 ms |
1164 KB |
Output is correct |
9 |
Correct |
0 ms |
1164 KB |
Output is correct |
10 |
Correct |
0 ms |
1164 KB |
Output is correct |
11 |
Correct |
0 ms |
1164 KB |
Output is correct |
12 |
Runtime error |
0 ms |
1160 KB |
SIGSEGV Segmentation fault |
13 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
1164 KB |
Output is correct |
2 |
Correct |
0 ms |
1164 KB |
Output is correct |
3 |
Correct |
0 ms |
1164 KB |
Output is correct |
4 |
Correct |
0 ms |
1164 KB |
Output is correct |
5 |
Correct |
0 ms |
1164 KB |
Output is correct |
6 |
Correct |
0 ms |
1164 KB |
Output is correct |
7 |
Correct |
0 ms |
1164 KB |
Output is correct |
8 |
Correct |
0 ms |
1164 KB |
Output is correct |
9 |
Correct |
0 ms |
1164 KB |
Output is correct |
10 |
Correct |
0 ms |
1164 KB |
Output is correct |
11 |
Correct |
0 ms |
1164 KB |
Output is correct |
12 |
Runtime error |
0 ms |
1160 KB |
SIGSEGV Segmentation fault |
13 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
1164 KB |
Output is correct |
2 |
Correct |
0 ms |
1164 KB |
Output is correct |
3 |
Correct |
0 ms |
1164 KB |
Output is correct |
4 |
Correct |
0 ms |
1164 KB |
Output is correct |
5 |
Correct |
0 ms |
1164 KB |
Output is correct |
6 |
Correct |
0 ms |
1164 KB |
Output is correct |
7 |
Correct |
0 ms |
1164 KB |
Output is correct |
8 |
Correct |
0 ms |
1164 KB |
Output is correct |
9 |
Correct |
0 ms |
1164 KB |
Output is correct |
10 |
Correct |
0 ms |
1164 KB |
Output is correct |
11 |
Correct |
0 ms |
1164 KB |
Output is correct |
12 |
Runtime error |
0 ms |
1160 KB |
SIGSEGV Segmentation fault |
13 |
Halted |
0 ms |
0 KB |
- |