B - Count the Colors
Time Limit:2000MS Memory Limit:65536KB 64bit IO Format:%lld
& %llu
Submit Status
Description
Painting some colored segments on a line, some previously pain...
分类:
其他好文 时间:
2015-07-08 22:42:09
阅读次数:
186
主题链接:http://poj.org/problem?id=2513Colored SticksTime Limit:5000MSMemory Limit:128000KTotal Submissions:30955Accepted:8159DescriptionYou are given a b...
分类:
其他好文 时间:
2015-07-08 12:37:31
阅读次数:
82
https://leetcode.com/problems/sort-colors/Sort ColorsGiven an array withnobjects colored red, white or blue, sort them so that objects of the same col...
分类:
编程语言 时间:
2015-07-03 12:02:12
阅读次数:
124
Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, white and blue.
Here, we will use the integers ...
分类:
其他好文 时间:
2015-07-03 09:13:50
阅读次数:
123
1.题目描述:点击打开链接
2.解题思路:本题实质上在问:给定一个长为L的字符串,在26个字符中选一个字符插入该串,可以形成多少个新的字符串。这就是一个简单的计数问题,长度为L的字符串有L+1个空位可以插入,一共有26*(L+1)个方法,考虑到相同字符的情况,要减去一个,一共有L种重复的情况,因此最终有26*(L+1)-L=25*(L+1)+1种情况。
3.代码:
#define _CRT_...
分类:
其他好文 时间:
2015-07-02 14:10:18
阅读次数:
101
A. Kyoya and Colored Balls一个背包有K种颜色一共N个球,颜色分别为1,2,3...K,颜色相同的球是不区别的。现在从背包里一个一个拿球直到所有球拿光,在拿光第I+1种颜色球之前一定要拿光第I种颜色的球,求有多少种拿法如 果只有一种颜色的球,拿的方法只有一种。如果有两种,留下...
分类:
其他好文 时间:
2015-06-29 13:16:22
阅读次数:
94
Problem Description
There is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is standing on a black tile. From a tile, he can move to one of four adja...
分类:
其他好文 时间:
2015-06-28 17:36:15
阅读次数:
155
problem题意本题题意不太容易看懂。给定一个序列,我们可以把这个序列变成一些循环置换的和。然而这种置换的方法是不止一种的。我们定义一种standard cyclic representation,即每个循环置换中最大的数都在第一个。把得到的循环置换的括号去掉,我们可以得到一个新的序列。定义一个序列,使得它变成置换后再去掉括号得到的新序列和原序列相同,那么称这样的序列是稳定的。给定一个n(序列长度...
分类:
其他好文 时间:
2015-06-27 19:54:07
阅读次数:
128
Let's define the permutation of length n as an array p?=?[p1,?p2,?...,?pn] consisting
of n distinct integers from range from 1 to n.
We say that this permutation maps value 1 into the value p1,
...
分类:
其他好文 时间:
2015-06-26 19:52:55
阅读次数:
118
Kyoya Ootori is selling photobooks of the Ouran High School Host Club. He has 26 photos, labeled "a" to "z", and he has compiled them into a photo booklet with some photos in some order (possibly with...
分类:
其他好文 时间:
2015-06-26 16:22:53
阅读次数:
160