제출 #945954

#제출 시각아이디문제언어결과실행 시간메모리
945954mansur게임 (IOI13_game)C++17
컴파일 에러
0 ms0 KiB
#include "game.h" #include<bits/stdc++.h> using namespace std; #define all(a) a.begin(), a.end() #define rall(a) a.rbegin(), a.rend() #define sz(a) (int)a.size() #define s second #define f first using ll = long long; using pii = pair<int, int>; using pll = pair<ll, ll>; const int N = 2e3 + 5; int n, m, lg[N], pw[7]; ll vl[N][N], up[N][N][7]; 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 get(int R, int l, int r) { int k = lg[r - l + 1], p = l; ll res = 0; while (true) { res = gcd2(res, up[R][p][k]); p += pw[k]; if (p > r) break; p = min(p, r - pw[k] + 1); } return res; } void bld(int R, int p) { for (int k = 0; k < 7; k++) { for (int i = 0; i < m - pw[k] + 1; i++) { if (i > p || i + pw[k] <= p) continue; if (k) { int v = pw[k - 1]; up[R][i][k] = gcd2(up[R][i][k - 1], up[R][i + v][k - 1]); up[R][i][k] = gcd2(up[R][i][k], up[R][i + 2 * v][k - 1]); }else up[R][i][k] = vl[R][i]; } } } void init(int R, int C) { n = R, m = C; lg[0] = -1; pw[0] = 1; for (int i = 1; i < 7; i++) pw[i] = pw[i - 1] * 3; for (int i = 1; i <= m; i++) { lg[i] = lg[i / 3] + 1; } cout << '\n'; } void update(int P, int Q, ll K) { vl[P][Q] = K; bld(P); } ll calculate(int P, int Q, int U, int V) { ll ans = 0; for (int i = P; i <= U; i++) { ans = gcd2(ans, get(i, Q, V)); } return ans; }

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

game.cpp: In function 'void update(int, int, ll)':
game.cpp:69:7: error: too few arguments to function 'void bld(int, int)'
   69 |  bld(P);
      |       ^
game.cpp:43:6: note: declared here
   43 | void bld(int R, int p) {
      |      ^~~