Submission #413842

#TimeUsernameProblemLanguageResultExecution timeMemory
413842LouayFarahGame (IOI13_game)C++14
10 / 100
13102 ms9948 KiB
#include "bits/stdc++.h" #include "game.h" using namespace std; vector<vector<long long>> grid; vector<long long> em; int r, c; long long gcd2(long long a, long long b) { if(b==0) return a; return gcd2(b, a%b); } void init(int R, int C) { r = R; c = C; em.assign(c, 0); grid.assign(r, em); } void update(int P, int Q, long long K) { grid[P][Q] = K; } long long calculate(int P, int Q, int U, int V) { long long res = grid[P][Q]; for(int i = P; i<=U; i++) { for(int j = Q; j<=V; j++) { res = gcd2(res, grid[i][j]); } } return res; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...