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;
typedef long long ll;
ll gcd2(ll X, ll Y){
ll tmp;
while (X != Y && Y != 0){
tmp = X;
X = Y;
Y = tmp % Y;
}
return X;
}
map<pair<int,int>, ll> mp;
void init(int R, int C){
}
void update(int P, int Q, ll K){
mp[{P,Q}] = K;
}
ll calculate(int P, int Q, int U, int V){
ll answer = 0;
for (auto it : mp){
int p = it.first.first, q = it.first.second;
ll x = it.second;
if (P <= p and p <= U and Q <= q and q <= V)
answer = gcd2(answer, x);
}
return answer;
}
Compilation message (stderr)
grader.c: In function 'int main()':
grader.c:18:6: warning: variable 'res' set but not used [-Wunused-but-set-variable]
18 | 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... |