Submission #132307

#TimeUsernameProblemLanguageResultExecution timeMemory
132307ioilolcomHorses (IOI15_horses)C++14
0 / 100
1570 ms6520 KiB
#include "horses.h" #include <bits/stdc++.h> using namespace std; int n; const int mod=1000000007; int solve(int day,int horses, int X[], int Y[]){ 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,X,Y)+tosell*Y[day]); } ans%=mod; return ans; } int init(int N, int X[], int Y[]) { n=N; int ans=solve(0,1,X,Y); return ans; } int updateX(int pos, int val) { return 0; } int updateY(int pos, int val) { return 0; }

Compilation message (stderr)

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) {
                          ^~~
#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...