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 "fish.h"//sub3
#include <bits/stdc++.h>
using namespace std;
long long max_weights(int n, int m,vector<int> x,vector<int> y,vector<int> w)
{
long long tab[n]={0},dp[n]={0};
for(int a=0;a<m;a++)
tab[x[a]]+=w[a];
dp[0]=tab[0];
dp[1]=max(tab[0],tab[1]);
for(int a=2;a<n;a++)
dp[a]=max(dp[a-1],dp[a-2]+tab[a]);
return dp[n-1];
}
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |