Submission #626782

#TimeUsernameProblemLanguageResultExecution timeMemory
626782moyindavidCatfish Farm (IOI22_fish)C++17
0 / 100
40 ms8396 KiB
#include "fish.h" #include <bits/stdc++.h> using namespace std; long long max_weights(int N, int M, vector<int> X, vector<int> Y,vector<int> w) { map<int,long long> W; for(int i=0;i<M;i++) W[X[i]]=w[i]; long long dp[N+5]{0}; dp[N-1]=W[N-1]; dp[N-2] = max(W[N-1],W[N-2]); for(int i=N-3;i>=0;i--){ dp[i]=max(dp[i+1],W[i]+dp[i+2]); } return dp[0]; }
#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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...