Submission #1090355

#TimeUsernameProblemLanguageResultExecution timeMemory
1090355vjudge1Game (IOI13_game)C++14
10 / 100
13092 ms9144 KiB
#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; } vector<vector<ll> > v; ll i, j, an; void init(int R, int C) { v.resize(R); for (i = 0; i < R; i++) { v[i].resize(C); for (j = 0; j < C; j++) v[i][j] = 0; } } void update(int P, int Q, ll K) { v[P][Q] = K; } ll calculate(int P, int Q, int U, int V) { an = 0; for (i = P; i <= U; i++) { for (j = Q; j <= V; j++) an = gcd2(an, v[i][j]); } return an; }
#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...