Problem: 1137. Nth Tabonacci number Article directory Question interpretation Problem solving method dp dynamic programming Iterative optimization? the complexity Code Explanation of the question First, let’s explain the meaning of this question I believe that when readers see [Tepbonacci Numbers], they can’t help but think of [Fibonacci Numbers]. They are twin brothers. This Tepbonacci Number […]
Tag: numbers
[C Language] Print 9*9 multiplication table, find the number of 9 in 1-100, find 1/1-1/2+1/3-1/4 +…+ 1/99 – 100, find 1 For all numbers that are multiples of 3 between -100, find prime numbers, print leap years, find the greatest common divisor, and find the maximum value
Directory How many times does the number 9 appear in all integers from 1 to 100? Print all numbers that are multiples of 3 between 1 and 100 Output three integers from largest to smallest Print prime numbers between 100 and 200 Print leap years between 1000 and 2000 Given two numbers, find the greatest […]
64_Pandas converts and formats strings and numbers to each other
64_Pandas converts and formats strings and numbers This article describes how to convert between strings and numbers in pandas.DataFrame and pandas.Series, as well as how to change the format of strings. The contents are explained below. Type conversion (casting): astype() Convert number to string Convert string to number Overwrite column and add as new column […]
[Dynamic Programming] 70. Climbing stairs, 322. Exchange of change, 279. Perfect square numbers
Tips: Live hard and have a happy day Article directory 70. Climb the stairs Problem-solving ideas Problems encountered Code Summary of the question Complete knapsack problem, which can be transformed into different interview questions 322. Change exchange Problem-solving ideas Problems encountered Code Summary of the question 279. Perfect square numbers Problem-solving ideas Problems encountered Code […]
[Data structure – Binary tree 8] [Traversal and summation]: Find the sum of the numbers from the root to the leaf nodes
Without further ado, just shout a slogan to encourage yourself: Programmers will never be unemployed, programmers go to architecture! The theme of this blog is [Traversal and Summation], which is implemented using the basic data structure [Binary Tree]. The website for this high-frequency question is: CodeTop, and the filtering conditions are: Target company + Last […]
Eight numbers + magic board – BFS (minimum step model)
One and eight digits In a 3×3 grid, the eight numbers 1 to 8 and an x are distributed in the 3×3 grid without any overlap. For example: 1 2 3 x 4 6 7 5 8 During the game, x can be swapped with a number in one of the four directions (up, down, […]
[Dynamic Programming]: 509. Fibonacci numbers, 70. Climbing stairs, 746. Climbing stairs with minimum cost
Tips: Live hard and have a happy day Article directory 509. Fibonacci numbers Problem-solving ideas Problems encountered Code Summary of the question 70. Climb the stairs Problem-solving ideas Problems encountered Code Summary of the question 746. Climb the stairs with minimum cost Problem-solving ideas Problems encountered Code Summary of the question Today’s experience 509. Fibonacci […]
Storage of integers and floating point numbers in memory
1, Storage of integers in memory There are three ways to represent integers in binary: original code, complement code, and complement code. For integers, what is stored in memory is the complement. 2. Big and small endian byte order and byte order judgment 2.1, what is big and small endian In fact, when data of […]
[C Language] Storage and reading of floating point numbers in memory – underlying analysis
write in front Hello everyone, I am gugugu. I hope it will be helpful to you after reading it. Please correct me if I have any shortcomings! Learn and communicate together This article was first published by gugugu on CSDN If you need to reprint it, please notify me? Personal homepage: gugugu-high-quality blog Welcome everyone […]
SYSU SSE algorithm lab5–mandatory and optional problems(English Version) Merging fruits, line segment coverage, milking cows, equally dividing playing cards, and deleting numbers
A-Combine Fruit Problem Description Complete Code #include<iostream> #include<queue> using namespace std; int main() { int n; int x; int res=0; priority_queue<int,vector<int>,greater<int>> heap; // value_type,container_type,compare. // the compare defaults to less<value_type> cin>>n; while(n–){ cin>>x; heap.push(x); } while(heap.size()>1){ int top1=0,top2=0; top1=heap.top(); heap.pop(); top2=heap.top(); heap.pop(); res + =top1 + top2; heap.push(top1 + top2); } cout<<res<<endl; } Code Explanation […]