codeforces Epic Game 题解

Simon and Antisimon play a game. Initially each player receives one fixed positive integer that doesn't change throughout the game. Simon ...

2014-04-30 07:16:00 135 0

Codeforces Helpful Maths

Xenia the beginner mathematician is a third year student at elementary school. She is now learning the addition operation. The tea...

2014-04-30 07:11:00 98 0

Unique Binary Search Trees -- LeetCode


2014-04-30 06:16:00 92 0

Unique Binary Search Trees II -- LeetCode

原题链接:http://oj.leetcode.com/problems/unique-binary-search-trees-ii/这道题是求解所有可行的二叉查找树,从Unique Binary Search Trees中我们已经知道,可行的二叉查找树的数量是相应的卡特兰数,不是一个多项式时...

2014-04-30 06:15:00 79 0


Gabor的核函数参考的wiki 使用实数Real的公式计算核函数代码: Mat gaborFilter(Mat& img, Mat& filter){ int half_filter_size = (max(filter.rows,filter.cols)-...

2014-04-30 00:36:00 131 0

Codeforces A. Double Cola 题解

题目很奇怪,就是5个人排队喝可乐,喝完之后编程两个人,然后拍在队后面,然后继续喝可乐。 给出个数值,代表第几罐可乐,问会是第几个人喝到? http://codeforces.com/problemset/problem/82/A 一个数学问题,仔细点就好了。 要熟练的知识点: 1...

2014-04-29 18:16:00 94 0

Timus 1119. Metro 动态规划

Many of SKB Kontur programmers like to get to work by Metro because the main office is situated quite close the station Uralmash. So, since a sed...

2014-04-29 15:05:00 65 0

Timus 1104. Don’t Ask Woman about Her Age题解

Mrs Little likes digits most of all. Every year she tries to make the best number of the year. She tries to become more and more intelligent and ...

2014-04-29 12:27:00 54 0

Timus 1446. Sorting Hat 分类问题

At the start of each school year, a very important event happens at Hogwarts. Each of the first-year wizards and witches is assigned to one of th...

2014-04-29 09:31:00 65 0

Timus 1777. Anindilyakwa 奇怪的数数问题

The language of Australian aborigines anindilyakwa has no numerals. No anindilyakwa can say: “I've hooked eight fishes”. Instead, he say...

2014-04-29 08:43:00 59 0

Restore IP Addresses -- LeetCode


2014-04-29 05:01:00 47 0

Interleaving String -- LeetCode


2014-04-29 04:28:00 53 0

Timus 1644. A Whole Lot of Walnuts 算法

Ten big walnuts is a whole lot of walnuts, that's for sure! Two walnuts is too little for anybody. How about six walnuts? Is it a small numb...

2014-04-28 19:26:00 42 0

Timus 1510. Order 找到出现次数过半的数

A New Russian Kolyan likes two things: money and order. Kolyan has lots of money, but there is no order in it. One beautiful morning Kolyan under...

2014-04-28 18:19:00 74 0

Timus 1161. Stripies

Our chemical biologists have invented a new very useful form of life calledstripies(in fact, they were first called in Russian -polosatiki, but the...

2014-04-28 16:08:00 62 0

Timus 1642. 1D Maze迷宫

1D people lived in a 1D country. Everything in the country was one-dimensional, and everything was simple and clear: just one axis and two direct...

2014-04-28 15:28:00 55 0

Timus 2002. Test Task 一个登陆系统

It was an ordinary grim October morning. The sky was covered by heavy gray clouds. It was a little rainy. The rain drops fell on the windows with...

2014-04-28 15:04:00 53 0

Timus 1601. AntiCAPS 修正大写句子

The blonde Angela has a new whim: internet chats. Of course, as any blonde, she writes her messages using the upper case. You are the moderator o...

2014-04-28 14:59:00 56 0

Timus 1180. Stone Game 游戏题目

Two Nikifors play a funny game. There is a heap ofNstones in front of them. Both Nikifors in turns take some stones from the heap. One may take a...

2014-04-28 09:02:00 45 0

Timus 1796. Amusement Park 聪明题

On a sunny Sunday, a group of children headed by their teacher came to an amusement park. Aunt Frosya, who was a very kind and quiet person, work...

2014-04-28 07:52:00 53 0

Reverse Linked List II -- LeetCode


2014-04-28 04:58:00 33 0

Subsets II -- LeetCode

原题链接:http://oj.leetcode.com/problems/subsets-ii/ 这道题跟Subsets一样是经典的NP问题--求子集。比Subsets稍微复杂一些的是这里的集合中可能出现重复元素,因此我们在求子集的时候要避免出现重复的子集。在Subsets中我们每次加进一个元素...

2014-04-28 04:23:00 35 0

Timus 2011. Long Statement 排列组合的运用

Nikita, a schoolboy, is currently taking part in one of programming contests. He is really upset because all the problem statements are so long a...

2014-04-27 20:44:00 21 0

Timus 1404. Easy to Hack! 有一个密码问题

When Vito Maretti writes an important letter he encrypts it. His method is not very reliable but it’s enough to make any detective understand not...

2014-04-27 20:04:00 30 0

Timus 1120. Sum of Sequential Numbers 数学题

There is no involute formulation concerning factitiously activity of SKB Kontur in this problem. Moreover, there is no formulation at all. I...

2014-04-27 19:31:00 29 0

Timus 1139. City Blocks 题解

The blocks in the city of Fishburg are of square form.Navenues running south to north andMstreets running east to west bound them. A helicopter t...

2014-04-27 16:50:00 33 0

Timus 2005. Taxi for Programmers 题解

The clock shows 11:30 PM. The sports programmers of the institute of maths and computer science have just finished their training. The exhausted ...

2014-04-27 10:53:00 33 0

Timus 1712. Cipher Grille 题解

Our program committee uses different tools for problem development: a mailing list, a version control system, an administration system of theTimu...

2014-04-27 09:15:00 36 0

Timus 1935. Tears of Drowned 详解

Old Captain Jack Sparrow’s friend Tia Dalma, the fortuneteller and prophetess, often makes potions. She has an outstanding collection of the rare...

2014-04-27 07:28:00 27 0

Decode Ways -- LeetCode


2014-04-27 06:18:00 42 0

Recover Binary Search Tree -- LeetCode


2014-04-27 03:09:00 34 0

Timus 1025. Democracy in Danger 题解

Background In one of the countries of Caribbean basin all decisions were accepted by the simple majority of votes at the general meeting of ci...

2014-04-26 19:34:00 75 0

Timus 1654. Cipher Message 破解密码

Müller tried to catch Stierlitz red-handed many times, but always failed because Stierlitz could ever find some excuse. Once Stierlitz was lookin...

2014-04-26 18:44:00 39 0

Timus 1792. Hamming Code 题解

Let us consider four disks intersecting as in the figure. Each of the three shapes formed by the intersection of three disks will be called apeta...

2014-04-26 15:34:00 36 0

Timus 1131. Copying 数学公式的构造

A new educating program was received by the kindergarten. Of course, children have discovered it immediately and want to play with it as soon as ...

2014-04-26 14:25:00 24 0

Timus 1837. Isenbaev's Number 图论 题解

Vladislav Isenbaev is a two-time champion of Ural, vice champion of TopCoder Open 2009, and absolute champion of ACM ICPC 2009. In the time you w...

2014-04-26 13:19:00 29 0

Gray Code -- LeetCode


2014-04-26 06:22:00 47 0

Binary Tree Zigzag Level Order Traversal -- LeetCode

原题链接:http://oj.leetcode.com/problems/binary-tree-zigzag-level-order-traversal/这道题其实还是树的层序遍历Binary Tree Level Order Traversal,如果不熟悉的朋友可以先看看哈。不过这里稍微做...

2014-04-26 04:31:00 35 0

Scramble String -- LeetCode

原题链接:http://oj.leetcode.com/problems/scramble-string/这道题看起来是比较复杂的,如果用brute force,每次做切割,然后递归求解,是一个非多项式的复杂度,一般来说这不是面试官想要的答案。这其实是一道三维动态规划的题目,我们提出维护量res[...

2014-04-26 02:50:00 30 0

Timus 1723. Sandro's Book 题解

It's been quite a number of years since Lich Sandro retired. Sometimes in the evenings, when he feels especially lonely, he takes a book tha...

2014-04-25 18:41:00 53 0

取消 删除