Submission #866567

# Submission time Handle Problem Language Result Execution time Memory
866567 2023-10-26T12:13:09 Z vjudge1 Catfish Farm (IOI22_fish) C++17
0 / 100
21 ms 7768 KB
#include "fish.h"
#include<bits/stdc++.h>
using namespace std;
#define ll long long// !
#define sz(a) (int)a.size()
#define all(a) a.begin(),a.end()
#define F first
#define S second
const int MAXN = 1e5 + 3;

ll dp[MAXN][2];
ll a[MAXN];
ll max_weights(int n, int m, vector<int> X, std::vector<int> Y, vector<int> W) {
	// dp[i][j], for i'th column just before the j'th element
	vector<pair<int, int>> pos[MAXN];
	for (int i = 0; i < m; i++){
		a[X[i]+1] = W[i];
		pos[X[i]+1].push_back({Y[i], W[i]});
	}
	for (int i = 1; i <= n; i++){
		dp[i][0] = max(dp[i-1][1], dp[i-1][0]);
		dp[i][1] = max(dp[i-1][0]+a[i-1], dp[i-1][1]);
		if (i == n){
			dp[i][0] = max(dp[i-1][1] + a[i], dp[i-1][0]);
		}
	}
	return max(dp[n][0], dp[n][1]);
}
# Verdict Execution time Memory Grader output
1 Incorrect 21 ms 6864 KB 1st lines differ - on the 1st token, expected: '40313272768926', found: '803213453'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 2648 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 Correct 3 ms 4444 KB Output is correct
2 Correct 2 ms 4952 KB Output is correct
3 Incorrect 17 ms 7768 KB 1st lines differ - on the 1st token, expected: '21261825233649', found: '16359027219341'
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 2648 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 2 ms 2648 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 2 ms 2648 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 Correct 3 ms 4444 KB Output is correct
2 Correct 2 ms 4952 KB Output is correct
3 Incorrect 17 ms 7768 KB 1st lines differ - on the 1st token, expected: '21261825233649', found: '16359027219341'
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 21 ms 6864 KB 1st lines differ - on the 1st token, expected: '40313272768926', found: '803213453'
2 Halted 0 ms 0 KB -