# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
870663 | 2023-11-08T18:42:12 Z | Ludissey | Catfish Farm (IOI22_fish) | C++17 | 22 ms | 11100 KB |
#include "fish.h" #include <bits/stdc++.h> #define int long long using namespace std; vector<int> a; vector<int> memo; int N,M; int dp(int x){ if(memo[x]!=-1) return memo[x]; if(x>=M) return 0; int take=dp(x+2)+a[x+1]; if(x>0) take+=a[x-1]; return memo[x] = max(take, dp(x+1)); } long long max_weights(signed n, signed m, std::vector<signed> X, std::vector<signed> Y, std::vector<signed> W) { N=n; M=m; a.resize(N,0); memo.resize(N,-1); for (int i = 0; i < M; i++) a[X[i]] = W[i]; cout << dp(0); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 22 ms | 11100 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 348 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 2 ms | 3676 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 348 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 348 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 348 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 2 ms | 3676 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 22 ms | 11100 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |