이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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) {}
map<int, map<int, LL>> mp;
void update(int p, int q, LL k) {
mp[p][q] = 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 = gcd2(ans, mp[x][y]);
}
}
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... |