| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1365730 | stanirina | Catfish Farm (IOI22_fish) | C++20 | 13 ms | 3888 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) {
vector<long long> dp(n+1);
vector<int> w(n);
for(int i=0;i<m;i++)w[x[i]]=W[i];
dp[0]=0ll;
dp[1]=0ll;
dp[2]=(long long)max(w[0],w[1]);
for(int i=3;i<=n;i++){
dp[i]=max(max(dp[i-1],dp[i-2]+w[i-1]),max(dp[i-2]+w[i-2],dp[i-3]+w[i-1]+w[i-3]));
}
return dp[n];
}
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
