# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
834087 | 2023-08-22T10:40:36 Z | Trumling | Catfish Farm (IOI22_fish) | C++17 | 19 ms | 5588 KB |
#include "fish.h" #include<bits/stdc++.h> using namespace std; #define F first #define S second #define all(x) x.begin(),x.end() typedef long long ll; #define pb push_back #define INF 9999999999999999 long long max_weights(int N, int M, vector<int> X, vector<int> Y,vector<int> W) { vector<vector<ll>>dp(2,vector<ll>(N,0)); for(int i=0;i<M;i++) dp[1][X[i]]=W[i]; dp[1][0]=0; for(int i=1;i<N;i++) { dp[1][i]=dp[0][i-1]+W[i]; dp[0][i]=max(dp[0][i-1],dp[1][i-1]); dp[0][i]=max(dp[0][i],((i>1)?max(dp[1][i-2],dp[0][i-2]):0)+W[i-1]); } ll ans=0; for(int i=0;i<N;i++) ans=max(ans,max(dp[0][i],dp[1][i])); return ans; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 19 ms | 5588 KB | 1st lines differ - on the 1st token, expected: '40313272768926', found: '34455709198970' |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 212 KB | 1st lines differ - on the 1st token, expected: '2', found: '1' |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 3 ms | 3524 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 212 KB | 1st lines differ - on the 1st token, expected: '3', found: '2' |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 212 KB | 1st lines differ - on the 1st token, expected: '3', found: '2' |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 212 KB | 1st lines differ - on the 1st token, expected: '3', found: '2' |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 3 ms | 3524 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 19 ms | 5588 KB | 1st lines differ - on the 1st token, expected: '40313272768926', found: '34455709198970' |
2 | Halted | 0 ms | 0 KB | - |