N bulbs(规律)】的更多相关文章

N bulbs  Accepts: 408  Submissions: 1224  Time Limit: 10000/5000 MS (Java/Others)  Memory Limit: 65536/65536 K (Java/Others) Problem Description N bulbs are in a row from left to right,some are on, and some are off.The first bulb is the most left one…
N*M bulbs 题目连接: http://codeforces.com/contest/510/problem/C Description NM个灯泡排成一片,也就是排成一个NM的矩形,有些开着,有些关着,为了节约用电,你要关上所有灯,但是你又很懒. 刚好有个熊孩纸路过,他刚好要从左上角的灯泡走去右下角的灯泡,然后离开. 但是毕竟熊孩纸,熊孩纸在离开一个灯泡之前,一定会动一下当前开关,也就是开的变关,关的变开. 想问你可不可能关完所有的灯,同时熊孩纸也可以到达右下角的灯泡,然后离开. Inp…
Happy 2004 题意:s为2004^x的因子和,求s%29.     (题于文末) 知识点: 素因子分解:n = p1 ^ e1 * p2 ^ e2 *..........*pn ^ en 因子和:    Sum=(p1^0+p1^1-.p1^e1)*(p2^0+p2^1-p2^e2)--(pn^0+-pn^en) =; 积性函数:s(xy)=s(x)*s(y)    (比如:幂函数,因子和,欧拉函数,莫比乌斯函数) 对于正整数n的一个算术函数 f(n),若f(1)=1,且当a,b互质时f…
传送门 Description Chloe, the same as Vladik, is a competitive programmer. She didn't have any problems to get to the olympiad like Vladik, but she was confused by the task proposed on the olympiad. Let's consider the following algorithm of generating a…
//POJ3377 //DP解法-解有规律的最短路问题 //Time:1157Ms Memory:12440K #include<iostream> #include<cstring> #include<cstdio> using namespace std; #define MAXN 1000005 typedef long long LL; int n; int dp[MAXN][3]; int sr, st, er, ed; int main() { //freo…
A Simple Nim Problem Description   Two players take turns picking candies from n heaps,the player who picks the last one will win the game.On each turn they can pick any number of candies which come from the same heap(picking no candy is not allowed)…
--利用sqlserver来运算斐波那契规律 --利用事物与存储过程 declare @number intdeclare @A intdeclare @B intdeclare @C int set @A=1 set @B=2 set @Number=3 select @C=@A+@B while(@Number<60) begin    set @C=@A+@B  if(@@ERROR<>0)  goto errorhandler  print N'第'+convert(varcha…
黑莓末路 昨晚听FM里谈到了RIM这家公司,有分析师认为它需要很悲催的裁员90%,才能保证活下去.这是一个意料之中,但又有点兔死狐悲的消息.可能在不久的将来,RIM这家公司就会走到尽头,或被收购,或申请破产保护. RIM的黑莓手机以在911事件中仍然能够保持通信而名声大振,在此后美国政府与很多商务人士都采购了黑莓手机,由此黑莓把重点放在了安全性上.很遗憾的是,成也萧何败也萧何,黑莓从此以后错误的判断了智能手机的未来,一直死盯着安全与商务功能不放,最终走到了今天的地步. RIM的问题很多,比如在软…
Math.abs(~2018) 某前端群的入门问题长姿势了,一个简单的入门问题却引发了我的思考,深深的体会到自己在学习前端技术的同时忽略遗忘了一些计算机的基础知识. 对于 JS Math对象没什么可说的, Math.abs(x)指的是返回一个数的绝对值,而解题关键在“~2018”,乍一看,这是什么意思,不会是“-2018”符号打错了吧?细思一下才恍然大悟,这是取反操作符,故取相反数得结果为-2018,Math.abs(-2018) 即2018,大功告成!可是,输入进去发现,What!错误!Why…
COM中需要调用AddRef和Release的10条规律  …