이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "game.h"
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
void init (int r, int c) {
}
map<int,map<int,ll>> m;
set<int> s;
map<int,set<int>> A;
void update(int x, int y, ll v) {
m[x][y]=v;
s.insert(x);
A[x].insert(y);
}
ll calculate(int a, int b, int c, int d) {
ll ans=0;
auto it = s.lower_bound(a);
while (it!=s.end() && *it<=c) {
auto it2 = A[*it].lower_bound(b);
while (it2!=A[*it].end() && *it2 <= d) {
ans=__gcd(ans,m[*it][*it2]);
++it2;
}
++it;
}
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... |