# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
570448 | cpp219 | Kitchen (BOI19_kitchen) | C++17 | 437 ms | 115912 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<bits/stdc++.h>
#define ll int
#define ld long double
#define fs first
#define sc second
#define debug(y) cout<<y,exit(0)
using namespace std;
typedef pair<ll,ll> LL;
const ll N = 300 + 9;
const ll inf = 1e9 + 7;
ll n,m,k,a[N],dp[N][N*N],b[N],ans = inf,sum;
void endgame(){
cout<<"Impossible"; exit(0);
}
ll f(ll pos,ll total){
if (!pos && total) return -inf;
if (!total || !pos) return 0;
ll &res = dp[pos][total];
if (res != -1) return res;
res = f(pos - 1,total);
if (total >= b[pos]) res = max(res,f(pos - 1,total - b[pos]) + min(b[pos],n));
return res;
}
int main(){
ios_base::sync_with_stdio(NULL); cin.tie(0); cout.tie(0);
#define task "test"
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... |