码迷,mamicode.com
首页 >  
搜索关键字:c. dzy loves sequences    ( 1332个结果
Hdoj 5195 DZY Loves Topological Sorting 【拓扑】+【线段树】
DZY Loves Topological SortingTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others) Total Submission(s): 922 Accepted Submission(s): 269Problem Description A topolog...
分类:其他好文   时间:2015-05-01 23:53:36    阅读次数:129
BZOJ 4026 dC Loves Number Theory 分块+十字链表/可持久化线段树
题目大意:给定一个序列,多次询问某段区间乘积的φ\varphi值对10007771000777的模我竟然卡过去了233333 将序列分块,记录fi,jf_{i,j}表示第ii块左端点到第jj个点中出现的所有质数pp的p?1p\frac{p-1}p之积 每次询问[x,y][x,y],首先取出[x,y][x,y]区间内所有数的积,然后乘上fst,yf_{st,y}(其中stst是xx后面第一个块端点...
分类:其他好文   时间:2015-04-30 18:24:29    阅读次数:286
Codeforces Round #227 (Div. 2)---E. George and Cards(贪心, 树状数组+set维护, 好题!)
George is a cat, so he loves playing very much.Vitaly put n cards in a row in front of George. Each card has one integer written on it. All cards had distinct numbers written on them. Let’s number the...
分类:编程语言   时间:2015-04-29 21:54:23    阅读次数:211
[水+dfs] poj 2034 Anti-prime Sequences
题意: 给n,m,k。 排列n~m之间的所有数。 保证相邻的2~k位之和均不为素数。 思路: 直接DFS。 代码: #include"cstdlib" #include"cstdio" #include"cstring" #include"cmath" #include"queue" #include"algorithm" #include"iostream" #include"...
分类:其他好文   时间:2015-04-28 22:56:01    阅读次数:209
Codeforces Round #179 (Div. 2)---D. Greg and Graph(离线+floyd)
Greg has a weighed directed graph, consisting of n vertices. In this graph any pair of distinct vertices has an edge between them in both directions. Greg loves playing with the graph and now he has in...
分类:其他好文   时间:2015-04-27 15:17:42    阅读次数:112
LeetCode-Repeated DNA Sequences
题目链接:https://leetcode.com/problems/repeated-dna-sequences/ All DNA is composed of a series of nucleotides abbreviated as A, C, G, and T, for example: "ACGAATTCCG". When studying DNA, it is someti...
分类:其他好文   时间:2015-04-27 09:58:50    阅读次数:110
HDU5194 DZY Loves Balls【排列组合】
题目大意: 袋子里有N个黑球、M个白球。用1表示取出来的是黑球,0表示取出来的是白球。不放回 的从袋子里取出这N+M个球。求相邻取出的两个球第一个球白球,第二个球是黑球的期望 次数是多少,即出现"01"的期望次数是多少。 思路: 考虑期望可加。第i(1<=i<=N+M)个位置上出现白球的概率为M/(M+N),则i+1个位置上 出现黑球的概率为N/(M+N-1)。因为白球只能在1~M+N-1个位置上出现(后边还有黑球)。 所以出现"01"的次数为(M+n-1)次。则总的期望 = M/(M+N...
分类:其他好文   时间:2015-04-24 21:10:31    阅读次数:156
POJ1644:To Bet or Not To Bet(概率DP)
Description Alexander Charles McMillan loves to gamble, and during his last trip to the casino he ran across a new game. It is played on a linear sequence of squares as shown below.  A chip is...
分类:其他好文   时间:2015-04-23 23:30:27    阅读次数:290
codeforces 450 B Jzzhu and Sequences
题意:给出f1=x,f2=y,f(i)=f(i-1)+f(i+1),求f(n)模上10e9+7因为 可以求出通项公式:f(i)=f(i-1)-f(i-2)然后f1=x;f2=y;f3=y-x;f4=-x;f5=-y;f6=-y+x;f7=x; 发现是以6为循环的还有注意下余数为正,就每次加上一个mo...
分类:其他好文   时间:2015-04-23 15:11:59    阅读次数:136
hdu 5195 DZY Loves Topological Sorting 线段树+拓扑排序
DZY Loves Topological SortingTime Limit: 1 SecMemory Limit: 256 MB题目连接http://acm.hdu.edu.cn/showproblem.php?pid=5195DescriptionA topological sort or t...
分类:编程语言   时间:2015-04-22 00:18:43    阅读次数:203
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!