摘要: http://codeforces.com/contest/1217/problem/D D. Coloring Edges time limit per test 1 second memory limit per test 256 megabytes input standard input o 阅读全文
posted @ 2019-09-07 12:22 _HonEy 阅读(157) 评论(0) 推荐(0)
摘要: Kiki likes traveling. One day she finds a magic lamp, unfortunately the genie in the lamp is not so kind. Kiki must answer a question, and then the ge 阅读全文
posted @ 2019-08-26 23:23 _HonEy 阅读(296) 评论(0) 推荐(0)
摘要: ST表类似树状数组,线段树这两种算法,是一种用于解决区间最值查询问题的离线算法。与线段树相比,预处理复杂度同为O(nlogn),但查询复杂度ST表为O(1),比线段树查询O(lgN)小,但就不涉及修改的区间查询而言,ST表无疑是更好的选择。 ST表主体,即st[i][j],表示数据数组a[ ]从下标 阅读全文
posted @ 2019-08-22 22:23 _HonEy 阅读(152) 评论(0) 推荐(0)
摘要: Balanced Lineup(POJ - 3264) For the daily milking, Farmer John's N cows (1 ≤ N ≤ 50,000) always line up in the same order. One day Farmer John decides 阅读全文
posted @ 2019-08-22 22:23 _HonEy 阅读(118) 评论(0) 推荐(0)
摘要: Strip Alexandra has a paper strip with n numbers on it. Let's call them ai from left to right. Now Alexandra wants to split it into some pieces (possi 阅读全文
posted @ 2019-08-22 22:23 _HonEy 阅读(318) 评论(0) 推荐(0)
摘要: Frequent values You are given a sequence of n integers a 1 , a 2 , ... , a n in non-decreasing order. In addition to that, you are given several queri 阅读全文
posted @ 2019-08-22 22:23 _HonEy 阅读(158) 评论(0) 推荐(0)
摘要: 粗略的讲一下这两种算法,为老年痴呆做好准备(ノへ ̄、) DFS: 如上图,你将搜索整张图,而DFS的搜索方法就是,先一味的往前走!走到某个尽头后发现无路可走,后退。咦?后退一步有一个分岔口,这里有多个支路,选择一条没走过的继续走,碰到死胡同,后退,又到了这个分岔口,再去选择没走过的路,直到无路可走, 阅读全文
posted @ 2019-07-30 20:57 _HonEy 阅读(247) 评论(0) 推荐(0)
摘要: 比赛网址 http://47.96.116.66/contest.php?cid=1376 A题:分组 题目描述 小明的班级在上体育课,老师想让大家分成两组玩拔河。现在大家排成了一排,老师嫌麻烦,所以想直接在队伍中间找个位置断开,这样不就分成了两组了吗?但是这个老师的思维很奇怪,他觉得分成人数相等的 阅读全文
posted @ 2019-07-11 16:39 _HonEy 阅读(423) 评论(0) 推荐(0)
摘要: (这是博主的第一篇随笔,如有错误,敬请斧正)。 1:了解快速幂。 先把快速幂的代码呈上来。 这里要解释一下位运算‘&’和‘>>’。‘&’通常用于二进制取位操作,例如一个数 & 1 的结果就是取二进制的最末位。而‘>>’则是右移运算符,可以二进制去掉最后一位数字(相当于除二)。 那么,快速幂到底是什么 阅读全文
posted @ 2019-03-26 18:48 _HonEy 阅读(265) 评论(0) 推荐(0)