QOJ.ac

QOJ

Type: Editorial

Status: Open

Posted by: codeborec1

Posted at: 2026-08-22 15:45:46

Last updated: 2026-08-22 16:00:37

Back to Problem

User Editorial for problem COCI 2024/2025 problem 3

SUBTASK 1: In this subtask y = 0, so we can take every blue card for free. We look at every possible subset of red cards and compute the strength of the deck, keeping the value of the current maximal strength. time complexity: O(2^n n m)

SUBTASK 2: For every subset of red cards, we look at every possible subset of blue cards and compute the strength of the deck, keeping the value of the current maximal strength. time complexity: O(2^n 2^m)

SUBTASK 3: We look at every possible subset of red cards. For every blue card, we compute the strength change it'll bring if we add it to the deck. If a certain blue card has a positive strength change we can freely add it to deck time complexity O(2^n n m)

Comments

No comments yet.