# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
897973 | Faisal_Saqib | Game (IOI13_game) | C++17 | 0 ms | 0 KiB |
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 <iostream>
#include <set>
#include <map>
#include <vector>
#include <numeric>
using namespace std;
set<vector<long long>> have;
void init(int r, int c)
{
}
void update(int p, int q, long long k)
{
have.insert({p,q,k});
}
long long calculate(int p, int q, int u, int v)
{
long long g=0;
for(auto i:have)
if(p<=i[0] and i[0]<=u and q<=i[1] and i[1]<=v)
g=gcd(g,i[2]);
return g;
}