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 "game.h"
#include <vector>
using namespace std;
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;
}
vector <vector <int>> matrix;
void init(int R, int C) {
matrix.assign(R, vector<int>(C, 0));
}
void update(int P, int Q, long long K) {
matrix[P][Q] = K;
}
long long calculate(int P, int Q, int U, int V) {
int r = 0;
for (int i = P; i <= U; i++) for (int j = Q; j <= V; j++) r = gcd2(r, matrix[i][j]);
return r;
}
# | 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... |