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;
const int k_Inf = 1e9;
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;
}
map<pair<int, int>, long long> mp;
void init(int _r, int _c) {
}
void update(int p, int q, long long k) {
mp[{p, q}] = k;
}
long long calculate(int p, int q, int u, int v) {
long long ans = 0;
for(auto t: mp){
int x = t.first.first;
int y = t.first.second;
long long num = t.second;
if(p <= x && x <= u && q <= y && y <= v)
ans = gcd2(ans, num);
}
return ans;
}
Compilation message (stderr)
grader.c: In function 'int main()':
grader.c:18:6: warning: variable 'res' set but not used [-Wunused-but-set-variable]
int res;
^~~
# | 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... |