Breadth first search depth first search dynamic programming LeetCode topic: transmitting information

original text https://lwebapp.com/zh/post/l...problemChild A is playing A message passing game with his friends. The rules of the game are as follows:There are n players. All players are numbered 0 ~ n-1 respectively, of which the number of child A is 0Each player has A fixed number of other players who can transmit information (or not). The re ...

Posted by koglakci on Tue, 01 Mar 2022 08:20:37 +0100

Shu Chuan's going to the meeting alone

Problem surface Description [title background] In 215 ad, Liu Bei took Yizhou, and Sun Quan ordered Zhuge Jin to ask Liu Bei for Jingzhou. Liu Bei refused, and Sun Quan was so angry that he sent LV Meng to lead the army to take Changsha, Lingling and Guiyang. Changsha, Guiyang and Shu will surrender immediately. After learning that, Liu B ...

Posted by Bladescope on Fri, 18 Feb 2022 21:46:05 +0100

BFS and DP -- the 70th biweekly match of Li Kou

⭐ New pit in winter vacation -- daily question notes of code Fox First question, greedy thought (take the largest two at a time, and then the largest third for free - the amount of sugar you can take for free is limited. Why not take one expensive one for free) The second problem is mathematical thinking (all numbers are in a range, so you onl ...

Posted by sparrrow on Wed, 02 Feb 2022 18:05:46 +0100

[WC2022] selected lectures on miscellaneous topics - Deng Mingyang

Quotations First of all, please attach the quotation of Mr. Deng. If there is anything you haven't collected, please let me know. "Competition in the same field" "The advantage is in me" I'm a fan of coconut juice. I'm good at typesetting. Don't look at \ (\ tt steam \), it's boring. stars Title Description A star can be a ...

Posted by InfiniteA on Thu, 27 Jan 2022 11:40:06 +0100

P2081 [NOI2012] lost amusement park

Title portal P2081 Some definitions: Define that \ (fa_ \) represents the father of \ (u \), \ (facet_ \) represents the number of parent nodes of \ (u \) (value \ (1 \) or \ (2 \)), \ (son_ \) represents the number of sons of \ (u \), \ (ch_ \) represents the child nodes of \ (u \), and \ (down_ \) represents the expected path length starting ...

Posted by TempleDMDKrazd on Sat, 15 Jan 2022 01:38:05 +0100

LeetCode-416. Split equal sum subset

Topic source 416. Segmentation and subsets Title details Give you a non empty array containing only positive integers, {nums. Please judge whether this array can be divided into two subsets so that the sum of the elements in the two subsets is equal. Example 1: Input: num = [1,5,11,5] Output: true Explanation: an array can be divided into [1, 5 ...

Posted by mattcass on Tue, 04 Jan 2022 08:12:18 +0100

[improvement group training 2021] Round2

I'm too lazy to talk nonsense. I'm a fool. C Title Description Given a tree with \ (n \) points, record \ (L(u,v) \) as the number of points on the \ ((u,v) \) simple path. For the path \ ((a,b),(c,d) \) point disjoint Quad \ ((a,b,c,d) \), we want to know how many different values \ ((L(a,b),L(c,d)) \) have. \(n\leq 5\cdot 10^5\) solution The ...

Posted by gigabyt3r on Fri, 12 Nov 2021 03:07:43 +0100

Noip simulation 85 2021.10.29 (to depression Trilogy)

preface Thanks to the author, I was directly depressed in the examination room Although I only saw Darling in the FRANXX, I still felt bad for \ (ichigo \) for a long time T1 \ ((ichigo) \) I came to see you dressed up like you like, Guang, no, da, darling Uncomfortable!!! But it's hard for me to cut \ (T1 \) without cutting it off On the exa ...

Posted by le007 on Fri, 29 Oct 2021 12:32:40 +0200

Educational codeforces round 112 (rated for Div. 2)

A. PizzaForces A. PizzaForces Easy to understand, omitted Idea: simply be greedy. Divide n into such forms as n=10+x+10y, then 10y individuals use y large cakes, and the remaining 10+x uses three combinations of cakes to see which saves the most time AC_code: #include<bits/stdc++.h> using namespace std; typedef long long ll; int main( ...

Posted by jola on Thu, 16 Sep 2021 02:35:10 +0200