"Paradigm Cup" 2023 Nowcoder Summer Multi-School Training Camp 1 K-Subdivision

AI Translated from Chinese Problem Problem Statement Given a tree, for each node, consider the maximum value d such that after removing d edges, the node can still reach at least one other node. Compute the sum of these d values across all nodes. Input The first line contains an integer n (1 ≤ n ≤ 2×10^5), the number of nodes in the tree. The next n-1 lines contain edges of the tree. ...

2023/07/24 · Allen Wu

Codeforces Round 867 (Div. 3) Solutions

First CF solution write-up

2023/04/25 · Allen Wu

Allen's Dynamic Programming Basics

States and state transition equations

2023/03/13 · Allen Wu

Allen's Graph Theory Basics

For example… the one-stroke problem?

2023/02/26 · Allen Wu

Path Finding - 8-Puzzle Problem

Hash and BFS

2023/01/27 · Allen Wu

The Organic Combination of Generation and Testing - Backtracking

Reducing unnecessary enumeration

2022/12/03 · Allen Wu

The Beauty of Data Structures - Binary Tree

Everything looks like a binary tree lately (

2022/11/06 · Allen Wu

First Look at Data Structures - Stack

Simple yet not so simple

2022/10/30 · Allen Wu

Python Generating Polynomials and Newton's Method

Collision of Python and mathematics

2022/10/02 · Allen Wu

Tower of Hanoi for C Language Beginners

AI Translated from Chinese Introduction In India, there is an ancient legend. In the temple of Benares, at the center of the world, a brass plate holds three diamond needles. When the Hindu god Brahma was creating the world, he threaded 64 gold discs from large to small onto one of the needles from bottom to top. This is the so-called Tower of Hanoi. Day and night, a monk constantly moves these gold discs to another needle according to the following rules: Only one disc can be moved at a time, and a smaller disc must always be on top of a larger one. When all the gold discs have been moved from the needle where Brahma threaded them to the third needle, the world will be destroyed in a thunderclap, and the tower, temple, and all living beings will perish together… ...

2022/09/11 · Allen Wu