码迷,mamicode.com
首页 >  
搜索关键字:c. dzy loves sequences    ( 1332个结果
BZOJ3850: ZCC Loves Codefires
题目:http://www.lydsy.com/JudgeOnline/problem.php?id=3850题解:类似于国王游戏,推一下相邻两个元素交换的条件然后排个序就可以了。代码: 1 #include 2 3 #include 4 5 #include 6 7 #include 8 ...
分类:其他好文   时间:2015-01-08 20:00:59    阅读次数:231
linux命令之date
date用法1: 格式:date [OPTION]... [+FORMAT] FORMAT controls the output. Interpreted sequences are:...
分类:系统相关   时间:2015-01-08 00:58:21    阅读次数:290
BZOJ 3850: ZCC Loves Codefires【贪心】
Though ZCC has many Fans, ZCC himself is a crazy Fan of a coder, called "Memset137".It was on Codefires(CF), an online competitive programming site, t...
分类:其他好文   时间:2015-01-07 16:35:55    阅读次数:269
【BZOJ】【3850】ZCC Loves Codefires
贪心,就跟NOIP2012国王游戏差不多,考虑交换相邻两题的位置,对其他题是毫无影响的,然后看两题顺序先后哪个更优。sort即可。WA了一次的原因:虽然ans开的是long long,但是在这一句:ans+=time*a[i].k;时,还是需要在time(int类型)前面加上(LL)进行类型强制转换...
分类:其他好文   时间:2015-01-07 10:38:48    阅读次数:124
poj 1492 Up and Down Sequences 模拟计数
水题,直接贴代码。 //poj 1492 //sep9 #include using namespace std; int a[64]; int n; void deal() { int up=0,down=0,upSum=0,downSum=0; int i,j; for(i=1;i<n;){ if(a[i]<a[i+1]){ ++up; for(j=i+1;j<=...
分类:其他好文   时间:2015-01-07 01:53:11    阅读次数:163
BZOJ 3563 DZY Loves Chinese / BZOJ 3569 DZY Loves Chinese II 随机化+高斯消元解异或方程组
题目大意:给出一个无向图,问删掉k条边的时候,图是否联通。 思路:虽然我把这两个题放在了一起,但是其实这两个题可以用完全不同的两个解法来解决。 第一个题其实是DZY出错了。。。把每次的边数也异或了,那就直接用这个性质一个一个往后推就行了。。最后一个暴力求一下。。 第二个题才是本意啊。 听到做法的时候我惊呆了。。 首先是将整个图中拆出一个树,那么所有边就分为树边和非树边。将所有非树...
分类:其他好文   时间:2014-12-25 16:29:58    阅读次数:233
BZOJ 3309 DZY Loves Math 莫比乌斯反演
题目大意: 枚举d=gcd(i,j),得到 现在我们只需要知道Σ[d|T]f(d)μ(T/d)的前缀和就行了 设这个函数为g(x) 观察这个函数 由于含平方因子数的μ值都为零,因此我们只考虑μ(T/d)!=0的数 令T=p1^a1*p2^a2*...*pk^ak,d=p1^b1*p2^b2*...*pk^bk 那么0 如果存在ai≠aj(i≠j),那么我们可以将所有的a...
分类:其他好文   时间:2014-12-24 13:31:37    阅读次数:220
C语言排序(12)___Can you find it?(Hdu 2141)
Problem Description Give you three sequences of numbers A, B, C, then we give you a number X. Now you need to calculate if you can find the three numbers Ai, Bj, Ck, which satisfy the formula Ai+Bj...
分类:编程语言   时间:2014-12-22 16:17:44    阅读次数:252
LCS problem using Binary-Search\Rolling hash
One TopCoder article introduces a very interesting alternative solution to Longest Common Sequences problem.It is based on this statement (http://comm...
分类:其他好文   时间:2014-12-20 10:26:37    阅读次数:240
武汉科技大学ACM:1005: Soapbear and Honey
Problem DescriptionSoapbear is the mascot of WHUACM team. Like other bears, Soapbear loves honey very much, so he decides to get some honeycombs for h...
分类:其他好文   时间:2014-12-19 20:36:01    阅读次数:269
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!