# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1004162 | vjudge1 | Horses (IOI15_horses) | C++17 | 1595 ms | 10332 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "horses.h"
#include <bits/stdc++.h>
using namespace std;
#define ins insert
#define pb push_back
#define pii pair<int, int>
#define endl '\n'
#define drop(x) cout<<(x)<<endl; return;
#define all(x) x.begin(),x.end()
const int mod = 1e9 +7, sze = 5*1e5, prime = 23;
int arr[sze],brr[sze];
int n;
const int dse = 1e3 +10;
int dp[dse][dse][3];
int rec(int i,int horses,int curr){
if(i==n){
return curr;
}
int mx =0 ;
horses = horses*arr[i];
for(int j=0;j<=horses;j++){
mx=max(mx, rec(i+1, horses-j , curr + j * brr[i]));
}
return mx;
}
int func(){
int ans=0;
return rec(0,1,0);
}
int init(int N, int X[], int Y[]) {
n=N;
for(int i=0;i<n;i++){
arr[i]=X[i];
brr[i]=Y[i];
}
return func();
}
int updateX(int pos, int val) {
return 0;
}
int updateY(int pos, int val) {
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |