Analysis of leetcode problem solving ideas 735 - 743 questions
Star collision Given an integer array astroids, the planets in the same row are represented. For each element in the array, its absolute value represents the size of the planet, and positive and negative represents the moving direction of the planet (positive represents moving to the right, negative represents moving to the left). Each planet m ...
Added by CrusaderSean on Sat, 15 Jan 2022 00:33:37 +0200
[NOIP2010 improvement group] solution to the problem of water diversion into the city
Title portal
General idea of the topic
Title Description
In a distant country, there are beautiful lakes on one side and boundless deserts on the other. The administrative division of the country is very special, just forming a rectangle with \ (N \) rows \ (\ times M \) columns, as shown in the above figure. Each grid represents a city, and ea ...
Added by ravnen on Mon, 03 Jan 2022 12:09:57 +0200
No. 406 of the 24 force deduction hot question brushing record The cohort was reconstructed according to height
Catalogue of series articles
Force deduction hot question brushing record
preface
Make a little progress every day!!
1, Background
For a group of people, there are two information about them. The first is the height information, and the second is how many people are taller (> =) than them in front of them. According to these informa ...
Added by reinmedia on Mon, 03 Jan 2022 06:10:58 +0200
2021 scuacm training team winter selection 2 most questions
Portal
I was at the end of the preview course, but I still couldn't help writing a set of questions
A
Check in. How many digits of the number are 9.
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
#define rep(i,a,b) for(int i = (a);i <= (b);++i)
#define re_(i,a,b) for(int i = (a);i < (b);++i)
#define dwn(i,a, ...
Added by Angerslave on Tue, 28 Dec 2021 03:50:16 +0200
Lesson 5 string
1. Basic knowledge
1. Characters and integers can be converted to each other, for example
#include <iostream>
using namespace std;
int main()
{
char a1[] = {'C', '+', '+'};
cout <<"a1:" << a1 << " size:" << sizeof(a1) << endl;
char a2[] = {'C', '+', '+', '\0'};
cout <<"a2:" << a2 <& ...
Added by XenoPhage on Fri, 24 Dec 2021 22:57:18 +0200
Knapsack problem (various categories)
Mainly write: 0-1 backpack, complete backpack (unlimited number of coins in change), multiple backpack (limited number of coins in change), fractional backpack
0-1 backpack: there are N items and a backpack with a capacity of V. each item can only be used once. The volume of article I is v[i], and the value is w[i]. Solve which items are loade ...
Added by Maracles on Tue, 21 Dec 2021 23:53:54 +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
[data structure] Trie tree (dictionary tree)
1 Basic Concepts
Trie tree (dictionary tree), also known as word lookup tree, is a data structure that can efficiently store and find string sets (not limited to strings). In y's eyes, it is a very simple data structure. It includes the following three properties:
The root node does not contain characters. Except for the root node, each node ...
Added by robembra on Tue, 21 Dec 2021 13:43:52 +0200
Greedy Title on Final Review - Course Schedule III
subject
Solving problems
This question is very touching, the last final exam is just in progress, my review (preview) is also in progress, I am a kid who often skips classes (...)
How do you review at the end of the term? We must first review the subjects that are closest to the exam time. This topic gives you review time for only one ...
Added by Rose.S on Tue, 14 Dec 2021 19:33:11 +0200
Learning notes -- understanding and code analysis of SA solving traveling salesman problems
1 understanding of simulated annealing
As a heuristic search method, simulated annealing is different from Monte Carlo method, enumeration method and other blind search methods, that is, it can use the information in the search process to improve the search strategy. Therefore, the characteristic of heuristic search method is that it helps ...
Added by jkm4201 on Sat, 11 Dec 2021 08:33:28 +0200