Submission #29123

# Submission time Handle Problem Language Result Execution time Memory
29123 2017-07-18T10:35:24 Z nibnalin Game (IOI13_game) C++14
10 / 100
0 ms 2104 KB
#include <iostream>
#include <cstdio>
#include <vector>
#include "game.h"
using namespace std;

const long long maxn = 105;

long long A[maxn][maxn];

long long gcd2(long long X, long long Y) {
	long long tmp;
	while (X != Y && Y != 0) {
		tmp = X;
		X = Y;
		Y = tmp % Y;
	}
	return X;
}

void init(int R, int C) {
	return;
}

void update(int P, int Q, long long K) {
	A[P][Q] = K;
}

long long calculate(int P, int Q, int U, int V) {
	long long res = 0;
	for(int i = min(P, U);i <= max(P, U);i++)
	{
		for(int j = min(Q, V);j <= max(Q, V);j++) res = gcd2(res, A[i][j]);
	}
	return res;
}

Compilation message

grader.c: In function 'int main()':
grader.c:18:6: warning: variable 'res' set but not used [-Wunused-but-set-variable]
  int res;
      ^
# Verdict Execution time Memory Grader output
1 Correct 0 ms 2104 KB Output is correct
2 Correct 0 ms 2104 KB Output is correct
3 Correct 0 ms 2104 KB Output is correct
4 Correct 0 ms 2104 KB Output is correct
5 Correct 0 ms 2104 KB Output is correct
6 Correct 0 ms 2104 KB Output is correct
7 Correct 0 ms 2104 KB Output is correct
8 Correct 0 ms 2104 KB Output is correct
9 Correct 0 ms 2104 KB Output is correct
10 Correct 0 ms 2104 KB Output is correct
11 Correct 0 ms 2104 KB Output is correct
12 Correct 0 ms 2104 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 2104 KB Output is correct
2 Correct 0 ms 2104 KB Output is correct
3 Correct 0 ms 2104 KB Output is correct
4 Runtime error 0 ms 2104 KB Execution killed with signal 11 (could be triggered by violating memory limits)
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 2104 KB Output is correct
2 Correct 0 ms 2104 KB Output is correct
3 Correct 0 ms 2104 KB Output is correct
4 Correct 0 ms 2104 KB Output is correct
5 Correct 0 ms 2104 KB Output is correct
6 Correct 0 ms 2104 KB Output is correct
7 Correct 0 ms 2104 KB Output is correct
8 Correct 0 ms 2104 KB Output is correct
9 Correct 0 ms 2104 KB Output is correct
10 Correct 0 ms 2104 KB Output is correct
11 Correct 0 ms 2104 KB Output is correct
12 Runtime error 0 ms 2104 KB Execution killed with signal 11 (could be triggered by violating memory limits)
13 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 2104 KB Output is correct
2 Correct 0 ms 2104 KB Output is correct
3 Correct 0 ms 2104 KB Output is correct
4 Correct 0 ms 2104 KB Output is correct
5 Correct 0 ms 2104 KB Output is correct
6 Correct 0 ms 2104 KB Output is correct
7 Correct 0 ms 2104 KB Output is correct
8 Correct 0 ms 2104 KB Output is correct
9 Correct 0 ms 2104 KB Output is correct
10 Correct 0 ms 2104 KB Output is correct
11 Correct 0 ms 2104 KB Output is correct
12 Runtime error 0 ms 2104 KB Execution killed with signal 11 (could be triggered by violating memory limits)
13 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 2104 KB Output is correct
2 Correct 0 ms 2104 KB Output is correct
3 Correct 0 ms 2104 KB Output is correct
4 Correct 0 ms 2104 KB Output is correct
5 Correct 0 ms 2104 KB Output is correct
6 Correct 0 ms 2104 KB Output is correct
7 Correct 0 ms 2104 KB Output is correct
8 Correct 0 ms 2104 KB Output is correct
9 Correct 0 ms 2104 KB Output is correct
10 Correct 0 ms 2104 KB Output is correct
11 Correct 0 ms 2104 KB Output is correct
12 Runtime error 0 ms 2104 KB Execution killed with signal 11 (could be triggered by violating memory limits)
13 Halted 0 ms 0 KB -