이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "bits/stdc++.h"
#include "game.h"
#ifdef mlocal
#include "grader.c"
#endif
using namespace std;
#define for_(i, s, e) for (int i = s; i < (int) e; i++)
#define for__(i, s, e) for (ll i = s; i < e; i++)
typedef long long ll;
typedef vector<int> vi;
typedef array<int, 2> ii;
#define endl '\n'
const int MXU = 22000;
map<ii, ll> updates;
void init(int R, int C) {
/* ... */
}
void update(int P, int Q, long long K) {
updates[{P, Q}] = K;
// cu++;
}
long long calculate(int P, int Q, int U, int V) {
ll g = 0;
for (auto &v: updates) {
if (v.first[0] < P) continue;
else if (v.first[0] > U) break;
else if (v.first[1] >= Q and v.first[1] <= V) {
if (g == 0) g = v.second;
else g = __gcd(g, v.second);
}
}
return g;
}
# | 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... |