Submission #426602

#TimeUsernameProblemLanguageResultExecution timeMemory
426602Aldas25Game (IOI13_game)C++14
10 / 100
1 ms460 KiB
#include "game.h"
#include <bits/stdc++.h>

using namespace std;

#define FOR(i, a, b) for (int i = (a); i <= (b); i++)
#define REP(n) FOR(O, 1, (n))
#define f first
#define s second
#define pb push_back
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vii;
typedef long long ll;
typedef vector<ll> vl;

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;
}

ll grid[110][110];

void init(int R, int C) {

}

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

long long calculate(int P, int Q, int U, int V) {
    ll ans = 0;
    FOR(i, P, U) FOR(j, Q, V) ans = gcd2(ans, grid[i][j]);
    return ans;
}
#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...