会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
Forrest
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
18
19
20
21
22
2016年11月20日
poj 3264 【线段树】
摘要: 此题为入门级线段树 题意:给定Q(1<=Q<=200000)个数A1A2…AQ,多次求任一区间Ai-Aj中最大数和最小数的差 #include<algorithm> #include<cstdio> #include<string> #include<string.h> #include<iostr
阅读全文
posted @ 2016-11-20 13:27 demianzhang
阅读(207)
评论(0)
推荐(0)
2016年11月19日
PAT A 1016. Phone Bills (25)【模拟】
摘要: 题目:https://www.patest.cn/contests/pat-a-practise/1016 思路:用结构体存储,按照名字和日期排序,然后先判断是否有效,然后输出,时间加减直接暴力即可
阅读全文
posted @ 2016-11-19 01:06 demianzhang
阅读(391)
评论(0)
推荐(0)
2016年11月17日
PAT A 1013. Battle Over Cities (25)【并查集】
摘要: https://www.patest.cn/contests/pat-a-practise/1013 思路:并查集合并
阅读全文
posted @ 2016-11-17 16:12 demianzhang
阅读(293)
评论(0)
推荐(0)
hihoCoder 1391 Countries【预处理+排序+优先队列】2016北京网络赛
摘要: 题目:http://hihocoder.com/problemset/problem/1391 题目大意: A和B两个国家互射导弹,每个国家都有一个防御系统,在防御系统开启的时间内可以将到达本国的导弹反弹回去(掉头,防御系统不能开开关关)。 现在已知:Ta、Tb为A、B两国导弹防御能开启的持续时间,
阅读全文
posted @ 2016-11-17 13:29 demianzhang
阅读(344)
评论(0)
推荐(0)
2016年11月16日
PAT A 1014. Waiting in Line (30)【队列模拟】
摘要: 题目:https://www.patest.cn/contests/pat-a-practise/1014 思路: 直接模拟类的题。 线内的各个窗口各为一个队,线外的为一个,按时间模拟出队、入队。 注意点:即使到关门时间,已经在服务中的客户(窗口第一个,接待时间早于关门时间)还是可以被服务的。其它的
阅读全文
posted @ 2016-11-16 18:50 demianzhang
阅读(525)
评论(0)
推荐(1)
codeforces Round#379 div.2
摘要: 第一次打Codeforces,纪念一下 前两题水题不表 第三题:二分 因为有序二分查出符合要求最大的第二种魔法,再遍历第一种魔法 第四题: 734D Anton and Chess 几何+模拟 一开始理解错题意以为是一边下棋一边check,其实不是最后check 最后In Check的棋子来自kin
阅读全文
posted @ 2016-11-16 16:45 demianzhang
阅读(220)
评论(0)
推荐(0)
2016年11月14日
PAT A 1004. Counting Leaves (30)【vector+dfs】
摘要: 题目链接:https://www.patest.cn/contests/pat-a-practise/1004 大意:输出按层次输出每层无孩子结点的个数 思路:vector存储结点,dfs遍历
阅读全文
posted @ 2016-11-14 18:23 demianzhang
阅读(208)
评论(0)
推荐(0)
2016年10月27日
POJ 1163:The Triangle
摘要: Description 7 3 8 8 1 0 2 7 4 4 4 5 2 6 5 (Figure 1) Figure 1 shows a number triangle. Write a program that calculates the highest sum of numbers pass
阅读全文
posted @ 2016-10-27 00:12 demianzhang
阅读(393)
评论(0)
推荐(0)
2016年10月14日
LeetCode39/40/22/77/17/401/78/51/46/47/79 11道回溯题(Backtracking)
摘要: LeetCode 39 LeetCode 40 LeetCode 22 backtracking函数书写的一般规则: (1)函数参数一般要包括位置或者其它(如本题中的还可以剩余左括号个数及左边有多少个左括号没有关闭),这些都是为函数内容作为判断条件,要选择好。 (2)函数开头是函数终止条件(如本题中
阅读全文
posted @ 2016-10-14 23:14 demianzhang
阅读(342)
评论(0)
推荐(0)
上一页
1
···
18
19
20
21
22
公告