Use the stack to calculate the expression application - give the children questions and calculate the positive answer rate (and save the data)

(I) effect display Item bank XX.txt Answer process Storage record file xx.txt   (2) encapsulate the required +, -, and other symbols, and then write several judgment methods 1 public char[] op = {'+','-','*','/','(',')'}; 2 public String[] strOp = {"+","-","*","/","(",")"}; 3 public boolean isDigit(char c ...

Posted by sactown on Sat, 02 Nov 2019 12:57:29 -0700

C. Letters (prefix and, binary lookup)

Title Link: http://codeforces.com/problemset/problem/978/C   What's the meaning of the title: tell you several dormitories, and then how many rooms there are in each dormitories. The number of each room is added up from the first one at a time. Now I'll give you some envelopes with only the room number on them. Now let's judge which dormitori ...

Posted by donbueck on Sat, 02 Nov 2019 11:39:47 -0700

HDU-4568 TSP + shortest circuit

Meaning: for a matrix with n rows and m columns, the number on the matrix represents the passing cost (pay attention here to pay for each passing cost). There are several treasures on the matrix. The hunter can go in from any boundary, get all the treasures from the matrix and come out from any boundary. Solution: it should be easy to think of ...

Posted by bruckerrlb on Sat, 02 Nov 2019 10:43:10 -0700

P1598 vertical histogram

Input format:   Four lines of characters, consisting of uppercase letters, with no more than 100 characters per line   Output format:   It is composed of several lines, the first line is composed of spaces and asterisks, and the last line is composed of spaces and letters. Do not print unnecessary extra spaces at the end of any line. ...

Posted by bradlybrown on Sat, 02 Nov 2019 10:00:52 -0700

Brush title - serialize and deserialize binary tree

Original title: In fact, I don't know this type of question very well, so the code here mainly refers to the answers above the nine chapters. Here is my code: /** * Definition of TreeNode: * class TreeNode { * public: * int val; * TreeNode *left, *right; * TreeNode(int val) { * this->val = val; * this-&g ...

Posted by delorian on Sat, 02 Nov 2019 09:24:24 -0700

POJ1083Moving Tables (simple simulation)

Title Link: http://poj.org/problem?id=1083   As shown in the figure, there are 200 rooms on both sides of a corridor. Now, some pairs of rooms are given to exchange tables with each other, but the corridor can only be moved by one group at a time. That is to say, if two handling processes are crossed, they cannot be carried at the same tim ...

Posted by JJ2K on Sat, 02 Nov 2019 09:24:10 -0700

Quicksort Python

Learn python for the first time, use python to write fast 1 # -*- coding:utf-8 -*- 2 # @Time :2019/7/7 15:08 3 # @Author :Zeng Ge 4 5 def quick_sort(blist,low,high): 6 if low<high: # When there is only one element, it is no longer recursive 7 # Otherwise, the index will be out o ...

Posted by Fastback_68 on Sat, 02 Nov 2019 07:43:57 -0700

Luogu 1265 highway construction [minimum spanning tree]

Title: https://www.luogu.org/problemnew/show/P1265 There are coordinates of n cities. Each city applies for and builds its own nearest city road. After that, they are regarded as a city. Continue until all cities are one. Ask how many roads to build at least. In the title, if a ring is formed, the shortest one should be removed. But cities a ...

Posted by robinjohn on Sat, 02 Nov 2019 05:53:46 -0700

Java uses thread pool to insert or update data in batches

Requirements: when developing business reports, it is necessary to read data from MySQL database, then write it to the database, and run batches using scheduled tasks. Analysis: ① considering performance; ② MySQL is not as convenient and powerful as Oracle. To sum up, thread pool is used to insert MySQL database in batch Submission Scheme. Thi ...

Posted by Kasuke_Akira on Sat, 02 Nov 2019 04:34:20 -0700

kuangbin special topic a simple search for very Cola HDU - 1495

Title Link: https://vjudge.net/problem/HDU-1495 There are two empty cups (N l and M L respectively) and A full can of coke (S l), S = N + M, three containers can be poured into each other. If A is poured into B, there are only two cases:(1) pour all A into B, and the number of liters in B is less than or equal to the maximum capacity of B.(2) ...

Posted by fukas on Sat, 02 Nov 2019 04:01:05 -0700