제출 #531336

#제출 시각아이디문제언어결과실행 시간메모리
531336DJ035게임 (IOI13_game)C++17
컴파일 에러
0 ms0 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 505 #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(ret) ret = gcd(ret, a[i][j]); } } return ret; }

컴파일 시 표준 에러 (stderr) 메시지

game.cpp: In function 'void update(int, int, long long int)':
game.cpp:41:15: error: 'k' was not declared in this scope
   41 |     a[P][Q] = k;
      |               ^