제출 #927801

#제출 시각아이디문제언어결과실행 시간메모리
927801VMaksimoski008말 (IOI15_horses)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #include "horses.h" #define sz(x) (int)x.size() #define all(x) x.begin(), x.end() #define rall(x) x.rbegin(), x.rend() //#define int long long using namespace std; using ll = long long; using pii = pair<int, int>; using pll = pair<ll, ll>; const int mod = 1e9 + 7; int n; vector<ll> X(5*maxn), Y(maxn); ll calc() { ll curr = 1, ans = 0; for(int i=0; i<n; i++) { curr = (curr * X[i]) % mod; ans = max(ans, (curr * Y[i]) % mod); } return ans; } ll init(int N, int x[], int y[]) { n = N; for(int i=0; i<n; i++) X[i] = x[i], Y[i] = y[i]; return calc(); } ll updateX(int p, int v) { X[p] = v; return calc(); } ll updateY(int p, int v) { Y[p] = v; return calc(); }

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

horses.cpp:18:16: error: 'maxn' was not declared in this scope
   18 | vector<ll> X(5*maxn), Y(maxn);
      |                ^~~~
horses.cpp:18:25: error: 'maxn' was not declared in this scope
   18 | vector<ll> X(5*maxn), Y(maxn);
      |                         ^~~~
horses.cpp:29:4: error: ambiguating new declaration of 'll init(int, int*, int*)'
   29 | ll init(int N, int x[], int y[]) {
      |    ^~~~
In file included from horses.cpp:2:
horses.h:4:5: note: old declaration 'int init(int, int*, int*)'
    4 | int init(int N, int X[], int Y[]);
      |     ^~~~
horses.cpp:35:4: error: ambiguating new declaration of 'll updateX(int, int)'
   35 | ll updateX(int p, int v) {
      |    ^~~~~~~
In file included from horses.cpp:2:
horses.h:5:5: note: old declaration 'int updateX(int, int)'
    5 | int updateX(int pos, int val);
      |     ^~~~~~~
horses.cpp:40:4: error: ambiguating new declaration of 'll updateY(int, int)'
   40 | ll updateY(int p, int v) {
      |    ^~~~~~~
In file included from horses.cpp:2:
horses.h:6:5: note: old declaration 'int updateY(int, int)'
    6 | int updateY(int pos, int val);
      |     ^~~~~~~