会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
欲穷千里目,更上一层楼
Stay hungry, stay foolish.
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
9
10
11
12
13
14
15
16
17
···
22
下一页
2020年4月1日
Codeforces Round #630 (Div. 2)
摘要: A题 模拟过程考查对临界条件的判断 #include<bits/stdc++.h> using namespace std; int main() { int T; cin >> T; while (T--) { int A, B, C, D; cin >> A >> B >> C >> D; in
阅读全文
posted @ 2020-04-01 09:30 LightAc
阅读(208)
评论(0)
推荐(0)
2020年3月30日
求欧拉回路的算法学习
摘要: 在求解欧拉回路的问题中我们可以采用fleury算法。 然而在进行算法竞赛时,如果只是求欧拉回路我们可以采用DFS进行实现,需要注意的小细节时在输出边时需要在回溯阶段逆向输出因为遇到 1->2->3->2->1这种图会出现走死路情况 来看道例题: UVA10054 #include <bits/std
阅读全文
posted @ 2020-03-30 16:30 LightAc
阅读(883)
评论(0)
推荐(0)
2020年3月25日
算法学习_栈
摘要: 以蓝书为学习参考,进行的栈的学习 例题1: 实现一个栈,支持Push,Pop和GetMin(查询栈中最小的值)在O(1)完成 算法实现思路:建立两个栈,A存原本的数据,B存以栈底开头的每段数据的最小值 Push(X),在A中插入X,在B中插入min(B的栈顶数据,X)。执行GetMin只需要输出B.
阅读全文
posted @ 2020-03-25 22:37 LightAc
阅读(159)
评论(0)
推荐(0)
2020年3月19日
LeetCode刷题_140
摘要: class Solution { public: vector<string> wordBreak(string s, vector<string>& wordDict) { if (m.count(s)) return m[s]; //判断map中有没有s if (s.empty()) retur
阅读全文
posted @ 2020-03-19 16:55 LightAc
阅读(118)
评论(0)
推荐(0)
2020年3月18日
2020/3/20 刷题
摘要: 1. Sample Input 6 -2 11 -4 13 -5 -2 10 -10 1 2 3 4 -5 -23 3 7 -21 6 5 -8 3 2 5 0 1 10 3 -1 -5 -2 3 -1 0 -2 0 Sample Output 20 11 13 10 1 4 10 3 5 10 1
阅读全文
posted @ 2020-03-18 22:49 LightAc
阅读(116)
评论(0)
推荐(0)
2020/3/19 刷题
摘要: 最终刷题太多了博客思路慢慢更新 1.利用havel定理判断可不可以简单图化的一道好题 Sample Input 3 7 4 3 1 5 4 2 1 6 4 3 1 4 2 0 6 2 3 1 1 2 1 Sample Output YES 0 1 0 1 1 0 1 1 0 0 1 1 0 0 0
阅读全文
posted @ 2020-03-18 22:33 LightAc
阅读(166)
评论(0)
推荐(0)
2020年3月13日
2020/3/13_C++实验课
摘要: #include <iostream> #include <cmath> using namespace std; double calcualateCircle(double r = 0) { return acos(-1) * r * r; } double calcualateRectangl
阅读全文
posted @ 2020-03-13 09:06 LightAc
阅读(220)
评论(0)
推荐(0)
2020年3月12日
刷题(主要是DFS) 2020年3月12日
摘要: 1. Sample Input 9 5 2 1 5 2 1 5 2 1 4 1 2 3 4 0 Sample Output 6 5 #include <bits/stdc++.h> using namespace std; typedef long long ll; int a[100]; bool
阅读全文
posted @ 2020-03-12 23:06 LightAc
阅读(209)
评论(0)
推荐(0)
DFS的一些题2020/3/11
摘要: 1. Sample Input 6 9 ....#. .....# ...... ...... ...... ...... ...... #@...# .#..#. 11 9 .#......... .#.#######. .#.#.....#. .#.#.###.#. .#.#..@#.#. .#
阅读全文
posted @ 2020-03-12 08:19 LightAc
阅读(161)
评论(0)
推荐(0)
2020年3月7日
算法学习_匈牙利算法
摘要: 匈牙利算法 匈牙利算法是一种在多项式时间内求解任务分配问题的组合优化算法 该算法是求解二分图的完全匹配问题 建图:把行号放左边点集,列号放在右边点集。 关键是求该二分图的最小边覆盖点集使得每条边都被至少一个点覆盖。 算法模板: //使用bfs实现 int dfs(int e) { for(int i
阅读全文
posted @ 2020-03-07 22:15 LightAc
阅读(249)
评论(0)
推荐(0)
上一页
1
···
9
10
11
12
13
14
15
16
17
···
22
下一页
公告
返回顶端