Task Manager with Priority Queues

Medium Applied C++ OOP Mini Projects
Solve in Playground →

Problem Statement

Implement a `TaskManager` OOP wrapper around C++’s `std::priority_queue`. Read N tasks as ‘priority description’, process the highest priority first, and print description strings in order. If priorities are equal, preserve the order of insertion.

Input Format

Line 1: N. Next N lines: priority (int) and description string.

Output Format

Print descriptions ordered by priority descending, then order of arrival, separated by line breaks.

Constraints

1 <= N <= 30

Sample Input

3
1 LowTask
3 HighTask
2 MidTask

Sample Output

HighTask
MidTask
LowTask

Explanation

High priority (3) runs first, then mid (2), then low (1).

Starter Code

#include <iostream>
#include <queue>
#include <string>

class TaskManager {
public:
    // Write your code here
};

int main() {
    // Implement I/O logic here
    return 0;
}

Limits

  • Time Limit: 1s
  • Memory Limit: 256MB

Embedded C Programming

Updated: March 15, 2026
Intermediate

Embedded systems rely on efficient low-level programming to interact directly with hardware. In this course, you will learn how to write practical Embedded C programs used in real microcontroller-based systems. Rather than focusing only on theory, this course follows a practice-driven approach. Each lesson includes hands-on coding exercises that simulate real firmware development tasks used