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>
using namespace std;
#define ll long long
long long max_weights(int n, int m, vector<int> X, vector<int> Y,
vector<int> W)
{
ll o=0,e=0;
for(int i=0;i<m;i++){
// sm[X[i]+1][Y[i]+1]+=W[i];
if(X[i]%2==0)
e+=W[i];
else
o+=W[i];
}
return max(o,e);
// for (int i = 1; i <=n; ++i)
// for(int j=1;j<=n;++j)
// sm[i][j]+=sm[i][j-1];
// for(int i=2;i<=n;i++)
// for(int k=0;k<=n;k++){
// //cal inc
// for(int p=0;p<=k;p++)
// inc[i][k]=max(inc[i][k],max(inc[i-1][p]+sm[i-1][k]-sm[i-1][p],dp[i-1][p]));
// dp[i][k]=inc[i][k];
// for(int p=k+1;p<=n;p++)
// dp[i][k]=max(dp[i][k],dp[i-1][p]+sm[i][p]-sm[i][k]);
// // cout<<dp[i][k]<<' ';
// // if(k==n)
// // cout<<endl;
// }
// ll ans=0;
// for(int i=0;i<=n;i++)
// ans=max(ans,dp[n][i]);
// return ans;
}
# | 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... |