Submission #4614

# Submission time Handle Problem Language Result Execution time Memory
4614 2013-11-11T07:29:44 Z cki86201 Game (IOI13_game) C++
0 / 100
0 ms 1124 KB
#include "game.h"

//10point;

typedef long long ll;

bool flag;
int 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,ret=0;
	for(i=P;i<=U;i++)for(j=Q;j<=V;j++)ret=gc(ret,idx[i][j]);
	return ret;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 1124 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 1124 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 1124 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 1124 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 1124 KB Output isn't correct
2 Halted 0 ms 0 KB -