码迷,mamicode.com
首页 >  
搜索关键字:codeforces 197b limi    ( 12277个结果
Codeforces 442A Borya and Hanabi
有五种花色 外加 五种点数 共25张牌,每次有n张牌,主人知道这n张牌中有哪些牌,并且哪种牌有几张,但是不知道具体是哪张牌,他可以问某种花色,然后知道了哪几张是该花色,也可以问点数,然后就知道了哪几张是这个点数。最终可以把所有牌都确定下来,问最少要询问几次。这个题目一开始想到枚举(事实证明最后就是枚...
分类:其他好文   时间:2014-06-29 19:53:00    阅读次数:203
Codeforces 439E Devu and Birthday Celebration(计数问题)
题目链接:Codeforces 439E Devu and Birthday Celebration 题目大意:给出q,表示询问的次数,每次询问有n和f,问有多少种分类方法,将n分成f份,并且这f份的最大共约数为1. 解题思路:如果不考虑说最大共约数为1的话,那么问题很简单,就是f个数的和为n的种数C(f?1n?1).所以我们就尽量将问题转化成说f数的和为s的子问题。用容斥原理,总的可...
分类:其他好文   时间:2014-06-28 07:02:46    阅读次数:278
Codeforces 12E Start of the season 构造 一个n*n矩阵使得每行恰好有一个[0,n-1]且对称
题目链接:点击打开链接 题意: 给定一个n 构造 一个n*n矩阵使得每行恰好有一个[0,n-1]且关于主对角线对称 且主对角线必须全为0 #include #include #include #include #include #include #include #include #include #include #include using namespace std; #defin...
分类:其他好文   时间:2014-06-27 10:15:19    阅读次数:139
Codeforces 12D Ball 树状数组模拟3个元素的排序
题目链接:点击打开链接 #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define N 500005 #define ll int ll n; ll c[N], maxn; inline ll...
分类:其他好文   时间:2014-06-27 09:06:04    阅读次数:183
CodeForces 7D Palindrome Degree 字符串hash
题目链接:点击打开链接 #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define N 5001000 #define mod 1000000007 #define he...
分类:其他好文   时间:2014-06-27 07:35:50    阅读次数:178
Codeforces 10D LCIS 求最长公共上升子序列及输出这个子序列 dp
题目链接:点击打开链接 题意: 给定n长的一个序列 再给定k长的一个序列 求LCIS并输出这个子序列 如有多解输出任意解。。 = - = 敲的时候听着小曲儿pre的含义还没有想清楚,万万没想到就过了。。。 #include #include #include #include #include #include #include #include #include #incl...
分类:其他好文   时间:2014-06-26 13:16:45    阅读次数:269
Codeforces 15C Industrial Nim 简单博弈
题目链接:点击打开链接 题意: 给定n 下面n行,每行2个数u v 表示有v堆石子:u,u+1,u+2···u+v-1 问先手必胜还是后手必胜 思路: 首先根据Nim的博弈结论 把所有数都异或一下,看结果是0还是非0 而这里因为数字太多所以想优化 那么其实对于一个序列 u, u+1, u+2 ···· 显然 {4,5} {,6,7}, {8,9} 这样2个一组的异或结果就是1 ...
分类:其他好文   时间:2014-06-26 10:25:50    阅读次数:176
Codeforces 374D Inna and Sequence 二分+树状数组
题目链接:点击打开链接 给定n个操作,m长的序列a 下面n个数 if(co>=0)则向字符串添加一个co (开始是空字符串) else 删除字符串中有a的下标的字符 直接在序列上搞,简单模拟 #include #include #include #include #include #include #include #include #include #include using na...
分类:其他好文   时间:2014-06-26 07:52:58    阅读次数:226
Codeforces 10C Digital Root 规律题
题目链接:点击打开链接 #include #include #include #include #include #include #include #include #include #include using namespace std; #define N 1000005 #define ll __int64 ll num[10],n; ll go(ll x){ ll ans ...
分类:其他好文   时间:2014-06-26 07:31:44    阅读次数:191
Codeforces Round #253 (Div. 2), problem: (B)【字符串匹配】
简易字符串匹配,题意不难 1 #include 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 8 int main(){ 9 int i, j, k, t, n;10 int nu...
分类:其他好文   时间:2014-06-25 12:07:42    阅读次数:145
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!