1. How to handle exceptions in Python? 2. What is exception handling in Python? 4. Some preliminary knowledge of when to use exception handling network programming

abnormal 1. What is an exception An exception is a signal of a program error. Once an error occurs in the program, an exception will be generated. If it is not handled in the program, the exception will be thrown, and the operation of the program will be terminated. In Python, the exceptions triggered by errors are as follows There are t ...

Added by gnunoob on Thu, 03 Mar 2022 07:31:11 +0200

leetcode DFS+BFS+DSU question brushing summary 2

leetcode DFS+BFS+DSU question brushing summary 2 1-symmetric binary tree Title Link: Link here!!! Idea 1: iterative method For a binary tree, the left and right subtrees enter the queue respectively. If the left and right subtrees are empty, the traversal ends. If only one of the left and right subtrees is empty, or the root nodes of the left ...

Added by xlordt on Sun, 27 Feb 2022 15:58:15 +0200

LeetCode 1706. Where does the ball meet? Multiple solutions to one problem

1706. Where does the ball meet Problem solution Title Source: 1706. Where does the ball meet 2022.02.24 one question per day Daily question column address: LeetCode daily problem solution is being updated ❤️💕 Today's topic is easier. After solving the problem, I'll pack my bags and go back to school tomorrow. I hope it's easy tomorrow, hehe ...

Added by fredcool on Thu, 24 Feb 2022 12:28:42 +0200

[ACWing]2188. Upper and lower bounds of passive sink feasible flow

Title address: https://www.acwing.com/problem/content/2190/ Given a containing n n n points m m For a digraph with m edges, each edge has a lower bound and an upper bound. Find a feasi ...

Added by ajpasetti on Sun, 20 Feb 2022 07:23:11 +0200

Group B of JAVA University in the first game of the 12th Blue Bridge Cup 2021

Tip: This article has 6000 words, rough reading takes about 5 minutes and intensive reading takes about 30 minutes viewpoint This year's provincial tournament is a little different from the past. It pays more attention to mathematics, algorithms and ideas, and is a little closer to ACM. I believe this is a trend, and the future Blue Bri ...

Added by sella2009 on Sun, 20 Feb 2022 06:43:35 +0200

Search algorithms DFS, BFS, backtracking

Deep search Deep search DFS. When a new node is found, it will immediately traverse the new node. It needs to use stack implementation or recursive implementation equivalent to stack. If the parent node of the traversal loop has a different record, it can also be used to detect each parent node. Sometimes we may need to mark the nodes ...

Added by meltingpotclub on Fri, 11 Feb 2022 07:32:19 +0200

Java crack 9X9 Sudoku games

background Recently, I brushed this interesting topic on LeetCode and thought of my love for Sudoku in junior high school. I couldn't help feeling very much. It turns out that this program can produce results in less than 1m, which made me waste so much time to study before. effect It is said that this is the most difficult Sudoku topic [cli ...

Added by sabbagh on Mon, 31 Jan 2022 09:15:13 +0200

Kiner algorithm: deep search (DFS) and wide search (BFS): first understanding the problem state space (hand tearing algorithm)

Guide to series of articles Guide to series of articles Open source project All articles in this series will be included in GitHub for unified collection and management. Welcome ISSUE and Star. GitHub portal: Kiner algorithm preface After understanding the core concept of search algorithm, knowing what problem solving tree is, and masteri ...

Added by scottb1 on Sat, 22 Jan 2022 15:38:33 +0200

NOIP2012] cultural tour - (search question)

Link: https://ac.nowcoder.com/acm/problem/16577 Source: niuke.com Title Description There is a messenger who wants to travel around countries. Every time he goes to a country, he can learn a culture, but he is unwilling to learn any culture more than once (that is, if he learns a culture, he can't reach other countries with this culture). Diff ...

Added by jimdy on Sat, 22 Jan 2022 06:57:38 +0200

Niuke practice 87

A. median Title: Given the array a1,a2,..., an with length n, do exactly k operations. Each operation selects two different positive integers i,j so that ai=ai+aj, and deletes aj from the array. What is the minimum median of the sequence after k operations? Median: a sequence with a length of M. its median is the number of floor ⌊ 2m+1 ...

Added by jwer78 on Tue, 21 Dec 2021 23:15:53 +0200