제출 #531339

#제출 시각아이디문제언어결과실행 시간메모리
531339DJ035게임 (IOI13_game)C++17
0 / 100
1 ms460 KiB
#include "game.h" #pragma GCC optimize("O3") #pragma GCC optimize("Ofast") #pragma GCC optimize("unroll-loops") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,avx,avx2") #include <bits/stdc++.h> #define MEM 2222 #define sanic ios_base::sync_with_stdio(0) #define x first #define y second #define pf push_front #define pb push_back #define all(v) v.begin(), v.end() #define sz size() using namespace std; typedef long long ll; typedef pair<ll, ll> pi; const ll INF = 1e9+7; const ll MOD = 998244353; ll gcd(ll a, ll b){ if(a%b) return gcd(b, a%b); return b; } ll n,m; ll a[MEM][MEM]; 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; } void init(int R, int C) { n = R, m = 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) { ll ret = -1; for(int i=P; i<=Q; i++){ for(int j=U; j<=V; j++){ if(ret<0) ret = a[i][j]; if(a[i][j]) ret = gcd(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...