剑绝尘
剑绝尘
全部文章
分类
题解(2)
归档
标签
去牛客网
登录
/
注册
剑绝尘的博客
全部文章
(共69篇)
题解 | 小欧的奇数
/* 题意是说找三个数,能否组成奇数,那其实只有两种组成方法,要么是三个奇数,要么是一个奇数两个偶数 所以我们只要奇数和偶数的数量,最后判断 if(cnt1>=3||(cnt1>=1&&cnt2>=2)) cout<<"YES\n&qu...
2025-05-02
0
30
题解 | 旅游
//这是一题树形dp,dp[cur][0]表示当前不选的最大值,dp[cur][1]表示当前选的最大值,最后dp[s][1]就是答案 #include <bits/stdc++.h> using namespace std; const int N = 5e5 + 10; int d...
2025-05-02
0
27
题解 | 矩阵的最小路径和
#include <bits/stdc++.h> using namespace std; const int N = 520; /* 每个位置的最小路径和肯定是从最小的左边或者上面转移过来的,所以有dp[i][j] += min(dp[i-1][j],dp[i][j-1]); 但是有...
2025-04-30
0
27
题解 | 游游的整数切割
#include <bits/stdc++.h> using namespace std; string str; int main(){ cin>>str; int ans = 0; for(int i = 0;i<str.size()-1...
2025-04-30
0
38
题解 | 最小花费爬楼梯
#include <bits/stdc++.h> using namespace std; const int N = 1e5 + 10; int n,dp[N],a[N]; int main(){ cin>>n; for(int i = 0;i<n...
2025-04-29
0
32
题解 | 游游的数字圈
#include <bits/stdc++.h> using namespace std; int main(){ string str; cin>>str; int ans = 0; for(auto x : str){ i...
2025-04-29
0
26
题解 | 能量项链
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 220; const int Mod = 1e9 + 7; ll a[N]; int n; ll dp[N][N]; i...
2025-04-28
0
32
题解 | 跳台阶扩展问题
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll dp[30]; int main(){ int n;cin>>n; dp[0] =dp[1] = 1; ...
2025-04-28
0
18
题解 | 小美的因子查询
#include <bits/stdc++.h> using namespace std; int main(){ int t;cin>>t; while(t--){ int x;cin>>x; if(x&...
2025-04-28
0
25
题解 | 括号区间匹配
#include <bits/stdc++.h> #include <climits> using namespace std; const int N = 101; string str; int dp[N][N]; bool check(char a,char b){...
2025-04-25
0
19
首页
上一页
1
2
3
4
5
6
7
下一页
末页