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 <bits/stdc++.h>
using namespace std;
using LL = long long;
vector<array<LL, 3>> h;
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) {}
void update(int p, int q, LL k) {
h.push_back({p, q, k});
return;
}
LL calculate(int p, int q, int u, int v) {
LL ans = 0;
for (auto& [x, y, k] : h) {
if (p <= x && x <= u && q <= y && y <= v) {
ans = (ans == 0 ? k : gcd2(ans, k));
}
}
return ans;
}
# | 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... |