Submission #729442

#TimeUsernameProblemLanguageResultExecution timeMemory
729442Blistering_Barnacles게임 (IOI13_game)C++11
0 / 100
1 ms296 KiB
#include "game.h"

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;
}
int a[105][105] ;
void init(int R, int C) {

}

void update(int P, int Q, long long K) {
    a[P][Q] = K ;
}

long long calculate(int P, int Q, int U, int V) {
    long long ret = 0 ;
    for(int i = P ; i <= U ; i++){
        for(int j = Q ; j <= V ; j++)ret = gcd2(ret , a[i][j]) ;
    }
    return ret ;
}
#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...