# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
963000 | n3rm1n | Game (IOI13_game) | C++17 | 1 ms | 348 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<bits/stdc++.h>
#include "game.h"
using namespace std;
int r, c;
void init(int R, int C)
{
r = R;
c = C;
}
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;
}
struct point
{
int x, y;
long long val;
point(){};
point(int _x, int _y, long long _val)
{
x = _x;
y = _y;
val = _val;
}
};
vector < point > g;
void update(int P, int Q, long long K)
{
P ++;
Q ++;
g.push_back(point(P, Q, K));
}
long long calculate(int P, int Q, int U, int V)
{
P ++;
Q ++;
U ++;
V ++;
long long ans = 0;
for (int i = 0; i < g.size(); ++ i)
{
if(g[i].x >= P && g[i].x <= U && g[i].y >= Q && g[i].y <= V)
ans = gcd2(ans, g[i].val);
}
return ans;
}
Compilation message (stderr)
# | 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... |