Submission #1090288

#TimeUsernameProblemLanguageResultExecution timeMemory
1090288vjudge1Game (IOI13_game)C++17
0 / 100
1 ms348 KiB
#include "game.h" #include <vector> using namespace std; 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; } vector <vector <int>> matrix; void init(int R, int C) { matrix.assign(R, vector<int>(C, 0)); } void update(int P, int Q, long long K) { matrix[P][Q] = K; } long long calculate(int P, int Q, int U, int V) { int r = 0; for (int i = P; i <= U; i++) for (int j = Q; j <= V; j++) r = gcd2(r, matrix[i][j]); return r; }
#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...