# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
146118 | 2019-08-22T09:12:15 Z | youssefbou62 | Game (IOI13_game) | C++14 | 0 ms | 0 KB |
#include <bits/stdc++.h> #include "game.h" using namespace std; using ll = long long ; const int N = 105 ; ll Mat[N][N] ; 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; } void init(int R, int C) { /* ... */ } void update(int P, int Q, long long K) { /* ... */ Mat[P][Q]=K; } long long calculate(int P, int Q, int U, int V) { /* ... */ ll ans = 0 ; for(int i = P ; <= U ; i++ ){ for(int j = Q;j<=V;j++ )ans = gcd2(ans,Mat[i][j]); } return ans; }