摘要: You are given a permutation p of length n. Remove one element from permutation to make the number of records the maximum possible. We remind that in a 阅读全文
posted @ 2018-01-13 18:57 Styx-ferryman 阅读(398) 评论(0) 推荐(0) 编辑
摘要: N ladies attend the ball in the King's palace. Every lady can be described with three values: beauty, intellect and richness. King's Master of Ceremon 阅读全文
posted @ 2018-01-06 14:50 Styx-ferryman 阅读(667) 评论(0) 推荐(0) 编辑
摘要: The new founded Balkan Investment Group Bank (BIG-Bank) opened a new office in Bucharest, equipped with a modern computing environment provided by IBM 阅读全文
posted @ 2017-12-24 20:14 Styx-ferryman 阅读(590) 评论(0) 推荐(2) 编辑
摘要: “tarjan陪伴强联通分量 生成树完成后思路才闪光 欧拉跑过的七桥古塘 让你 心驰神往” 《膜你抄》 自从听完这首歌,我就对tarjan开始心驰神往了,不过由于之前水平不足,一直没有时间学习。这两天好不容易学会了,写篇博客,也算记录一下。 一、tarjan求强连通分量 1、什么是强连通分量? 引用 阅读全文
posted @ 2017-11-05 11:12 Styx-ferryman 阅读(26871) 评论(21) 推荐(32) 编辑
摘要: 生命不息,学习不止,昨天学了两个算法,总结一下,然而只是略懂,请路过的大佬多多谅解。 一、dfs序 1、什么是dfs序? 其实完全可以从字面意义上理解,dfs序就是指一棵树被dfs时所经过的节点的顺序 原图来源于网络,并经过灵魂画师xhk的一发魔改。 好的,这张图的dfs序显然为A-B-D-E-G- 阅读全文
posted @ 2017-10-27 19:33 Styx-ferryman 阅读(20533) 评论(6) 推荐(33) 编辑
摘要: 好吧,这名字真是让我想起了某段被某教科书支配的历史.....各种DP题层出不穷,不过终于做完了orz 虽然各种手糊加乱搞,但还是要总结一下. T1 Monkey Banana Problem 这道题和数塔问题差不多,不过多了一个倒过来的 代码如下: T2Rooks T3Marriage Ceremo 阅读全文
posted @ 2017-10-24 18:25 Styx-ferryman 阅读(1391) 评论(0) 推荐(1) 编辑
摘要: A lot of battleships of evil are arranged in a line before the battle. Our commander decides to use our secret weapon to eliminate the battleships. Ea 阅读全文
posted @ 2017-10-08 15:50 Styx-ferryman 阅读(248) 评论(0) 推荐(0) 编辑
摘要: Given a simple graph, output the number of simple cycles in it. A simple cycle is a cycle with no repeated vertices or edges. Input The first line of 阅读全文
posted @ 2017-10-08 15:23 Styx-ferryman 阅读(1219) 评论(0) 推荐(0) 编辑
摘要: 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 to organize a game of Ultim 阅读全文
posted @ 2017-10-07 20:59 Styx-ferryman 阅读(241) 评论(0) 推荐(0) 编辑
摘要: In the game of DotA, Pudge’s meat hook is actually the most horrible thing for most of the heroes. The hook is made up of several consecutive metallic 阅读全文
posted @ 2017-10-07 12:35 Styx-ferryman 阅读(211) 评论(0) 推荐(0) 编辑