2804: 与指定数字相同的数的个数 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>typedef long long ll;const int N=1e5+5;ll a[N];using namespace…… 题解列表 2024年04月20日 0 点赞 0 评论 191 浏览 评分:2.0
题解 2804: 与指定数字相同的数的个数 摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using namespace std;typedef long long ll;ll a[101];int main()…… 题解列表 2024年04月20日 0 点赞 0 评论 206 浏览 评分:0.0
STL unordered_set完美解决问题 摘要:解题思路:把字符串中只出现一次的字符保存到set里。注意事项:题意要求输出第一次出现字符,所以需要遍历两次字符串。参考代码:#include <iostream>#include <string>#i…… 题解列表 2024年04月19日 0 点赞 0 评论 318 浏览 评分:0.0
BFS板子最最最基础题了 摘要:```cpp #include using namespace std; #define endl '\n' #define int long long typedef pair …… 题解列表 2024年04月19日 0 点赞 0 评论 550 浏览 评分:9.9
LETTEARS(走路径) 摘要:```cpp #include using namespace std; #define endl '\n' #define int long long const int N=2…… 题解列表 2024年04月19日 0 点赞 0 评论 359 浏览 评分:9.9
信息学奥赛一本通T1270-混合背包 摘要:解题思路:转化为完全背包, 当数量不限时,数量为背包容量除以物品体积注意事项:滚动数组优化, j 从m 到 w[i]参考代码:#include<iostream> #include<algorith…… 题解列表 2024年04月19日 0 点赞 0 评论 202 浏览 评分:9.9
八皇后(一维) 摘要:解题思路:1.首先要明确皇后的限制条件,由题目可知行,列,主对角线,反对角线均不可重复,那不妨设col,diag,rediag一维数组,当然二维数组同样适用 2.按题目要求只…… 题解列表 2024年04月19日 0 点赞 0 评论 537 浏览 评分:9.0
2133: 信息学奥赛一本通T1269-庆功会 摘要:解题思路:优化存储的版本和01背包类似注意事项:参考代码:#include<iostream> #include<algorithm> using namespace std; const in…… 题解列表 2024年04月18日 1 点赞 0 评论 169 浏览 评分:9.9
3156: 蓝桥杯2023年第十四届省赛真题-景区导游 摘要:解题思路:利用公式dis[a]-dis[b]-2*dis[lca(a,b)]求出a与b之间的距离,dis为此节点到根节点的距离注意事项:参考代码:#include<bits/stdc++.h> us…… 题解列表 2024年04月18日 0 点赞 0 评论 435 浏览 评分:0.0
信息学奥赛一本通T1268-完全背包问题 摘要:解题思路:完全背包注意事项:参考代码:#include<iostream> #include<algorithm> using namespace std; const int N = 2e2 …… 题解列表 2024年04月18日 0 点赞 0 评论 175 浏览 评分:9.9