p1164 number of dynamic programming solutions
Title Description
However uim, due to the purchase of some books, only M yuan (M ≤ 10000) remained in his pocket.
Although the restaurant is low-end, there are many kinds of dishes, including NN (N \le 100)(N ≤ 100), and the i sells ai , yuan (ai ≤ 1000). As it is a very low-end restaurant, there is only one dish for each dish.
Sma ...
Posted by R_P on Sun, 30 Jan 2022 02:29:04 +0100
2022 Niuke winter vacation algorithm basic training camp
Title Link
preface
I cooked a chicken and wrote that I went to eat halfway (I can't write the questions after I don't eat...), and I will make up the questions later Attached Official explanation
A zhinai's Hello XXXX
Problem solution
Nothing to say, direct output
code
print("hello ")
B zhinai buys melons
Problem solution / idea ...
Posted by lobo235 on Sat, 29 Jan 2022 13:04:47 +0100
State pressure dp (state compression, a number represents a group of States, and the reduced state represents the required dimension)
The problem of light out (state pressure + enumeration) enumerates the state of a row of switches with the size of binary numbers
#include <iostream>
#include <string.h>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
using namespace std;
char orilights[5] ;
char lights[5] ;
...
Posted by pdn on Fri, 28 Jan 2022 14:45:14 +0100
Knapsack problem of dynamic programming (java)
1, Dynamic programming
Dynamic Programming (DP) is a branch of operations research, which is the process of solving the optimization of decision-making process.
2, Basic thought
(1) divide the large problem into small problems to solve, so as to obtain the optimal solution step by step; (2) the dynamic progra ...
Posted by devilincarnated on Fri, 28 Jan 2022 14:00:55 +0100
Analysis of leetcode problem solving ideas 693 - 699 questions
Alternate bit binary number Given a positive integer, check whether its binary representation always alternates 0 and 1: in other words, the numbers of adjacent two digits in the binary representation will never be the same.
Get data by bit and XOR
class Solution {
public:
bool hasAlternatingBits(int n)
{
int a = n & 1;
...
Posted by a1amattyj on Fri, 28 Jan 2022 07:21:04 +0100
Summary of dynamic programming of leetcode 1(Java)
Summary of leetcode dynamic programming 1
1-longest palindrome substring Title Link: Title Link stamp here!!! The test passed several times. The AC code is as follows. The first use of violence enumeration, double pointer to judge palindromes, timeout. The second time, I thought it was OK to flip the string and compare it with the original st ...
Posted by lucym on Wed, 26 Jan 2022 19:23:27 +0100
[title record] - Asian regional competition of the 46th ICPC international college student programming competition (Shanghai)
Title set address
Asian regional competition of the 46th ICPC international college student programming competition (Shanghai)
The first training during the holiday, the effect was good, and I did two sign in questions of DE
This supplementary question:
DE (sign in)
G (DP on tree)
I (DP)
J (bit operation)
K (structure)
D Strange_Fr ...
Posted by miltonbanks on Wed, 26 Jan 2022 07:35:43 +0100
whp 6 - Codeforces Round #767 (Div. 2)
Codeforces Round #767 (Div. 2)
Codeforces Round #767 (Div. 2)
A. Download More RAM
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll N = 110;
struct node {
ll a, b;
};
node mp[N];
signed main() {
ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
ll T;
cin >> T;
...
Posted by tet3828 on Wed, 26 Jan 2022 01:58:48 +0100
Yiwen church 01 Backpack
01 Backpack
01 backpack refers to a topic template
If there are many things, each thing can only be loaded into a backpack once, and the backpack has an upper volume limit
This is the classic 01 knapsack problem
When we subconsciously recite the template
Let's first think about the violent solution to the 01 knapsack problem
In the 01 bac ...
Posted by kate_rose on Mon, 24 Jan 2022 21:49:08 +0100
Codeforces Round #767 (Div. 2) ABCD problem solving
A. Download More RAM
Idea:
sign
reach
topic
Check in question
Check in question
Press
mirror
a
from
...
Posted by screamer141 on Mon, 24 Jan 2022 08:43:52 +0100