Submission #1090289

#TimeUsernameProblemLanguageResultExecution timeMemory
1090289vjudge1Game (IOI13_game)C++17
10 / 100
13088 ms9052 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 <long long>> matrix; void init(int R, int C) { matrix.assign(R, vector<long long>(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) { long long 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...