码迷,mamicode.com
首页 >  
搜索关键字:codeforces 197b limi    ( 12277个结果
Codeforces Round #247 (Div. 2) C. k-Tree (dp)
题目链接题意:思路: 1 #include 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 const int mo = 1000000000 + 7; 8 int dp[110][110][110]...
分类:其他好文   时间:2014-05-26 14:02:48    阅读次数:264
转化一下就是01背包 CodeForces 433A - Kitahara Haruki's Gift
Kitahara Haruki has bought n apples for Touma Kazusa and Ogiso Setsuna. Now he wants to divide all the apples between the friends. Each apple weights 100 grams or 200 grams. Of course Kitahara Haru...
分类:其他好文   时间:2014-05-25 09:01:36    阅读次数:174
动态规划,就是这样! CodeForces 433B - Kuriyama Mirai's Stones
Kuriyama Mirai has killed many monsters and got many (namely n) stones. She numbers the stones from 1 to n. The cost of the i-th stone is vi. Kuriyama Mirai wants to know something about these sto...
分类:其他好文   时间:2014-05-25 07:24:48    阅读次数:315
看个人思路吧,清晰的话就简单 CodeForces 271A - Beautiful Year
It seems like the year of 2013 came only yesterday. Do you know a curious fact? The year of 2013 is the first year after the old 1987 with only distinct digits. Now you are suggested to solve the f...
分类:其他好文   时间:2014-05-24 21:52:34    阅读次数:320
Codeforces Round #247 (Div. 2) ABC
Codeforces Round #247 (Div. 2)...
分类:其他好文   时间:2014-05-24 14:21:30    阅读次数:195
Codeforces Round #246 (Div. 2)
C 这题说的是给了一个数列然后通过交换得到有序的数组 数列中的数只有满足距离j-i+1 为素数的时候才可以交换然后 根据哥德巴赫猜想就可以知道数之间的关系 然后通过交换得到他们的值,这里犯了一个严重的错误就是在计算的时候L[a[i]] 与 L[i] 的地址交换了 但是是 a[i] 与a[L[i]] ...
分类:其他好文   时间:2014-05-23 04:49:08    阅读次数:252
瞎翻译啊 CodeForces 41A - Translation
The translation from the Berland language into the Birland language is not an easy task. Those languages are very similar: a berlandish word differs from a birlandish word with the same meaning a litt...
分类:其他好文   时间:2014-05-23 02:27:26    阅读次数:587
Codeforces A. Valera and X 题解
判断二维字符串是否满足下面条件: on both diagonals of the square paper all letters are the same; all other squares of the paper (they are not on the diagonals) contain the same letter that is different from the...
分类:其他好文   时间:2014-05-23 02:21:01    阅读次数:294
Codeforces 432E Square Tiling(构造+贪心)
题目连接:Codeforces 432E Square Tiling 题目大意:给出一个n?m的矩阵,要求对该矩阵进行上色,用大写字母,但是每次上色的区域必须是正方形,不求相邻的上色区域不能有相同的颜色,求字典序最小的方案(字典序比较,从左至右,从上到下) 解题思路:用贪心的思想去构造矩阵,因为字典序的优先级为左至右,以及上到下,所以我们每次对于一个未上色点x,y,考虑最少要放到的长度...
分类:其他好文   时间:2014-05-22 07:53:17    阅读次数:280
codeforces round246 C
像这样的C题对自己来说才是最能提升思维的好题。 首先要知道这些数的组合都是从1-n, 要想对数进行排序,比如pos[i]=4(i位置的数值为4),比较容易能想到i和4直接交换, 题目要求每次交换(i,j)且(j-i+1)为素数,这地方卡住 其实可以利用哥德巴赫猜想(任一大于5的整数都可拆分为三个素数之和,任一大于2的偶数都可拆分为两个素数之和) 然后我们就可以贪心了,先把(j-i+1)拆...
分类:其他好文   时间:2014-05-22 06:36:46    阅读次数:303
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!