FOCUS-ASTU-TECH-COMMUNITY-ADVANCED-CP-CONTEST-1

Правка en2, от ayanasamuel, 2026-12-02 02:25:21

FOCUS-ASTU-TECH-COMMUNITY-ADVANCED-CP-CONTEST-1

Hello everyone!

Welcome to the editorial for FOCUS-ASTU-TECH-COMMUNITY-ADVANCED-CP-CONTEST-1. Our topics this season were Recursion, Trees and Linked Lists, so this set mixes classic implementation and constructive problems with problems where those three ideas give the cleanest solution (tree depth, tree construction, tree DP, recursive search and backtracking, and walking along chains of pointers).

Below you will find hints, tutorials, and solutions for each problem. We used spoiler tags to keep things clean. Try to solve it yourself before clicking!

Happy coding!

Problem-A:734480A - Tatar TV Show

Tags: Linked List Math Parity Constructive
Difficulty: ⭐⭐ (Easy)

This problem looks like a game on a string, but hidden inside it are several linked lists.

Understanding the Problem
Hint
Tutorial
Solution (Python)
Alternative Approach: One XOR per remainder

Problem-B:734480B - Erasing Zeroes

Tags: Strings Greedy Implementation Recursion
Difficulty: ⭐ (Very Easy)

Understanding the Problem
Hint
Tutorial
Solution (Python)
Alternative Approach: Recursion (peel the ends)

Problem-C:734480C - Party

Tags: Trees Recursion DFS Linked List
Difficulty: ⭐⭐ (Easy)

A very good first problem on tree depth.

Understanding the Problem
Hint
Tutorial
Solution (Python)
Alternative Approach: Walk up the manager pointers (Linked List)

Problem-D:734480D - Christmas Spruce

Tags: Trees Implementation Counting
Difficulty: ⭐⭐ (Easy)

Understanding the Problem
Hint
Tutorial
Solution (Python)
Alternative Approach: Count leaves with one array

Problem-E:734480E - Omkar and Heavenly Tree

Tags: Trees Constructive
Difficulty: ⭐⭐⭐ (Medium)

A constructive problem: you must build a tree that satisfies all the conditions. Any valid tree is accepted.

Understanding the Problem
Hint
Tutorial
Solution (Python)
Alternative Approach: Think of it as a tree with one special vertex

Problem-F:734480F - Bear and Compressing

Tags: Recursion Backtracking Brute Force Strings
Difficulty: ⭐⭐⭐ (Medium)

This is a pure recursion / backtracking problem: the constraints are tiny, so we simply try everything.

Understanding the Problem
Hint
Tutorial
Solution (Python)
Alternative Approach: Run it backwards

Problem-G:734480G - Idiot First Search

Tags: Trees DFS Dynamic Programming Recursion
Difficulty: ⭐⭐⭐⭐ (Hard)

The hardest problem of the set, but it follows the exact pattern we learned in the Trees lectures: compute a value from the children up (post-order), then push another value from the parent down (pre-order).

Understanding the Problem
Hint
Tutorial
Solution (Python)
Alternative Approach: Plain recursion (two DFS functions)

Problem-H:734480H - Undoubtedly Lucky Numbers

Tags: Recursion Backtracking DFS Brute Force Implementation
Difficulty: ⭐⭐⭐ (Medium)

Understanding the Problem
Hint
Tutorial
Solution (Python)
Alternative Approach: Choose the two digits first

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский ayanasamuel 2026-12-02 02:25:21 2 (published)
en1 Английский ayanasamuel 2026-12-02 02:20:09 36347 Initial revision (saved to drafts)