제출 #784023

#제출 시각아이디문제언어결과실행 시간메모리
784023SoulKnight메기 농장 (IOI22_fish)C++17
0 / 100
44 ms5408 KiB
#include "fish.h" #include <bits/stdc++.h> using namespace std; #define ll long long #define ln '\n' long long max_weights(int N, int M, std::vector<int> X, std::vector<int> Y, std::vector<int> W) { ll a[N+3]; memset(a, 0, sizeof(a)); for (int i = 0; i < M; i++){ a[X[i]+3] = W[i]; } ll dp[N+3]; memset(dp, 0, sizeof(dp)); for (int i = 0+3; i < N+3; i++){ dp[i] = max(dp[i-1], max( a[i-1] + dp[i-2], a[i] + a[i-2] + dp[i-3])); // cout << dp[i] << ln; } // cout << dp[N+2] << ln; return dp[N+2]; }
#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...