cyber1026
cyber1026
全部文章
分类
归档
标签
去牛客网
登录
/
注册
cyber1026的博客
全部文章
(共7篇)
题解 | #吃糖果# 动态规划
#include <iostream> #include <cstring> #include <algorithm> #include <cmath> using namespace std; const int N = 30; int dp[N]...
2024-03-24
0
62
题解 | #跳跃游戏(二)# 使用最大递增子序列的思想
当然这道题不要求递增,但是思想是类似的,需要加判断条件,另外,需要用变量m来优化时间复杂度 #include <iostream> using namespace std; const int N = 1e6; int a[N], n, dp[N], m=0; // m 是数组元素的最...
2024-03-18
0
61
题解 | #信封嵌套# 动态规划前先排序
#include <iostream> #include <algorithm> using namespace std; const int N = 2010; int n, dp[N]; struct letter { int a; int b; };...
2024-03-16
0
48
题解 | #最大公约数1#
#include <iostream> #include <algorithm> #include <vector> using namespace std; int main(){ int n; int a[100000000]; while( cin ...
2024-03-07
0
52
题解 | #求解立方根# 穷举法
#include <iostream> #include <cmath> using namespace std; int main(){ double num; while( cin >> num ){ double res=0; if( num ...
2024-03-05
0
43
题解 | #Graduate Admission#
#include <iostream> #include <algorithm> #include <vector> using namespace std; struct school{ int quota; int fact; int ge; int...
2024-03-03
0
67
题解 | #Sharing#
#include <iostream> using namespace std; struct node { char data; int next; }; int main() { // word1、word2是两个单词的首地址, addr用于输入,实际上不存...
2024-03-03
1
79