제출 #132305

#제출 시각아이디문제언어결과실행 시간메모리
132305ioilolcom말 (IOI15_horses)C++14
컴파일 에러
0 ms0 KiB
#include "horses.h" #include <bits/stdc++.h> using namespace std; int n; const int mod=1e9+7; int solve(int day,int horses){ if(day==n || horses==0) { return 0; } horses=horses*X[day]; int ans=0; for(int tosell=0; tosell<=horses; tosell++) { ans=max(ans,solve(day+1,horses-tosell)+toseint*Y[day]); } ans%=mod; return ans; } int init(int N, int X[], int Y[]) { n=N; int ans=solve(0,1); return ans; } int updateX(int pos, int val) { return 0; } int updateY(int pos, int val) { return 0; }

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

horses.cpp: In function 'int solve(int, int)':
horses.cpp:11:16: error: 'X' was not declared in this scope
  horses=horses*X[day];
                ^
horses.cpp:14:42: error: 'toseint' was not declared in this scope
   ans=max(ans,solve(day+1,horses-tosell)+toseint*Y[day]);
                                          ^~~~~~~
horses.cpp:14:42: note: suggested alternative: 'tosell'
   ans=max(ans,solve(day+1,horses-tosell)+toseint*Y[day]);
                                          ^~~~~~~
                                          tosell
horses.cpp:14:50: error: 'Y' was not declared in this scope
   ans=max(ans,solve(day+1,horses-tosell)+toseint*Y[day]);
                                                  ^
horses.cpp: In function 'int init(int, int*, int*)':
horses.cpp:19:23: warning: unused parameter 'X' [-Wunused-parameter]
 int init(int N, int X[], int Y[]) {
                       ^
horses.cpp:19:32: warning: unused parameter 'Y' [-Wunused-parameter]
 int init(int N, int X[], int Y[]) {
                                ^
horses.cpp: In function 'int updateX(int, int)':
horses.cpp:26:17: warning: unused parameter 'pos' [-Wunused-parameter]
 int updateX(int pos, int val) {
                 ^~~
horses.cpp:26:26: warning: unused parameter 'val' [-Wunused-parameter]
 int updateX(int pos, int val) {
                          ^~~
horses.cpp: In function 'int updateY(int, int)':
horses.cpp:30:17: warning: unused parameter 'pos' [-Wunused-parameter]
 int updateY(int pos, int val) {
                 ^~~
horses.cpp:30:26: warning: unused parameter 'val' [-Wunused-parameter]
 int updateY(int pos, int val) {
                          ^~~