[Dynamic Programming] They are Tabonacci numbers, not Fibonacci numbers

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 […]

[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 […]

[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 […]

[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 […]

[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 […]