Submission #983684

# Submission time Handle Problem Language Result Execution time Memory
983684 2024-05-15T23:08:27 Z mmk Jelly Flavours (IOI20_jelly) C++14
0 / 100
1 ms 348 KB
#include "jelly.h"
#include <vector>
#include<bits/stdc++.h>
using namespace std;
const int MAXN = 1e3 + 10;
const int MAXM = 1e4 + 10;

int dp[MAXN][MAXM];

int calc(int i, int x, int y, int N, vector<int> &a, vector<int> &b)
{
	if(x < 0 || y < 0) return -1;
	if(dp[i][x] != 0) return dp[i][x];
	if(i > N) return 0;

	int op1 = calc(i + 1, x - a[i - 1], y, N, a, b) + 1;
	int op2 = calc(i + 1, x, y - b[i - 1], N , a, b) + 1;

	dp[i][x] = max(op1,op2);
	return dp[i][x];
}


int find_maximum_unique(int x, int y, std::vector<int> a, std::vector<int> b) {
	int N = a.size();

	return calc(1,x,y,N,a,b);

}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB 1st lines differ - on the 1st token, expected: '8', found: '7'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB 1st lines differ - on the 1st token, expected: '8', found: '7'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB 1st lines differ - on the 1st token, expected: '689', found: '5'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB 1st lines differ - on the 1st token, expected: '62', found: '4'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB 1st lines differ - on the 1st token, expected: '154', found: '14'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB 1st lines differ - on the 1st token, expected: '8', found: '7'
2 Halted 0 ms 0 KB -