Maximizing Final Score in a Custom Jeopardy Game with Doubling Questions
In this problem, there are n questions with given point values and m special questions that allow doubling the current score instead of earning their base points. The goal is to arrange the order of answering all questions so that the final score is maximized.
Each question i has a fixed value val[i]. Among them, m indices correspond to doublin ...
Posted on Mon, 08 Jun 2026 16:10:56 +0000 by lorddraco98
Minimizing Camera Placement on a Binary Tree Using Greedy DFS
Given a binary tree, we need to install cameras on its nodes. Each camera can monitor its parent, itself, and its immediate children. The goal is to determine the minimum number of cameras reuqired to cover the entire tree.
Problem Constraints
Number of nodes ranges from 1 to 1000.
Node values are irrelevant (typically 0).
Core Strategy
The o ...
Posted on Fri, 05 Jun 2026 17:26:40 +0000 by buroy
Programming Contest Solutions and Algorithm Explanations
A. Programming Contest
This problem is a straightforward implementation task. The idea is to count the number of valid years betweeen two given years, excluding specific invalid years provided in the input.
void solve() {
int n, m;
std::cin >> n;
std::vector<int> invalidYearFlag(10000, 0); // Assuming a safe upper bound ...
Posted on Mon, 01 Jun 2026 17:35:16 +0000 by czs
Optimizing Team Performance with a Greedy Priority Queue Approach
Problem Definition
The objective is to select a team of at most k engineers from a pool of n candidates to maximize the team's performance metric. This metric is defined as the sum of the selected engineers' speeds multiplied by the minimum efficiency value among them. Given arrays representing the speed and efficiency of each engineer, the ta ...
Posted on Fri, 22 May 2026 17:41:14 +0000 by Rik Peters
Greedy Algorithm Applications: Digit Removal and Three-Value Sorting
Minimizing a Number by Removing Digits
The goal is to take a high-precision positive integer n (up to 240 digits) and remove s digits such that the remaining digits, in their original order, form the smallest possible integer.
Problem Strategy
A common mistake is to sort the digits and remove largest ones. However, this violates the rule of ma ...
Posted on Thu, 14 May 2026 14:08:55 +0000 by kucing
Maximum Credits from Homework Assignments Using Greedy Algorithm with Priority Queue
Problem Statement
A teacher assigns all homework on the first day of school. Each homework assignment earns credits only if submitted before its deadline. Each assignment has a different deadline and credit value, and each assignment requires exactly one day to complete.
For example, if a assignment has 10 credits with a deadline of 6 days, you ...
Posted on Sat, 09 May 2026 14:29:11 +0000 by plehmurof
Algorithmic Solutions for Codeforces Round 882 Division 2
Problem A: The Man who became a God
To solve this problem, consider the absolute differences between adjacent elements in the sequence. Let the sequence be (a_1, a_2, \dots, a_n). The total cost is initially the sum of (|a_i - a_{i+1}|) for all (1 \le i < n). The operation allows removing (k-1) of these differences to minimize the remaining ...
Posted on Thu, 07 May 2026 21:33:07 +0000 by Fearsoldier
Competitive Programming: Greedy Algorithms and Binary Search Strategies
Dynamic Bound Tracking for Absolute Value SumsWhen calculating the maximum possible sum of an array where an absolute value operation can be applied to the running total at any point, tracking the exact moment to apply the operation is complex. A flawed approach might conditionally apply absolute values based on the sign of the next element and ...
Posted on Thu, 07 May 2026 09:53:27 +0000 by cpace1983