Submission #673033

# Submission time Handle Problem Language Result Execution time Memory
673033 2022-12-19T12:34:58 Z Hacv16 Jelly Flavours (IOI20_jelly) C++17
0 / 100
2000 ms 1980300 KB
#include <bits/stdc++.h>
#include "jelly.h"
using namespace std;

#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")

const int MAX = 2005;
int n, a[MAX], b[MAX];

int find_maximum_unique(int x, int y, vector<int> _a, vector<int> _b) {
	n = _a.size();
	
	bool aux = true;

	for(int i = 1; i <= n; i++){
		a[i] = _a[i - 1];
		b[i] = _b[i - 1];

		aux &= (a[i] == b[i]);
	}

	assert(aux);

	if(aux){ x += y; y = 0; }

	vector<vector<vector<int>>> dp(n + 1, vector<vector<int>>(x + 1, vector<int>(y + 1, 0)));

	for(int i = 1; i <= n; i++){
		for(int j = 0; j <= x; j++){
			for(int k = 0; k <= y; k++){
				int cur = dp[i - 1][j][k];

				if(j >= a[i]) cur = max(cur, dp[i - 1][j - a[i]][k] + 1);
				if(k >= b[i]) cur = max(cur, dp[i - 1][j][k - b[i]] + 1);

				dp[i][j][k] = cur;
			}
		}
	}

	return dp[n][x][y];
}
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 468 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 468 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 468 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 468 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1582 ms 1112332 KB Output is correct
2 Execution timed out 2138 ms 1980300 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 468 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -