ural1682 Crazy Professor】的更多相关文章

Crazy Professor Time limit: 1.0 secondMemory limit: 64 MB Professor Nathan Mathan is crazy about mathematics. For an unknown reason, he started to write on the blackboard all positive integers starting from 1. After writing a new number a, Professor…
1628 加了些数论知识  先看下剩余类的概念 一个整数被正整数n除后,余数有n种情形:0,1,2,3,…,n-1,它们彼此对模n不同余.这表明,每个整数恰与这n个整数中某一个对模n同余.这样一来,按模n是否同余对整数集进行分类,可以将整数集分成n个两两不相交的子集.我们把(所有)对模n同余的整数构成的一个集合叫做模n的一个剩余类. 对于a%k=x b%k=y  若x!=y  a与b有边相连 则a的剩余类  与b的剩余类l里的元素也是可以相连的  即 a ->b->a+k->b+k-&g…
[题目链接] http://acm.timus.ru/problem.aspx?space=1&num=1682 [题目大意] 给出k,从1开始不断地加一并把这个数写在黑板上,如果写上的数字和之前的数字满足 (a+b*b)%k=0或者(b+a*a)%k=0就在他们之间连一条线,如果黑板上出现环就结束,问能写几个数 [题解] 我们发现写到2k-1的时候,就一定会产生一个环,所以我们只要枚举数字 往满足要求的地方连边,判断是否出现环即可 [代码] #include <cstdio> #in…
一直很想谈谈Continuous Integration(CI),持续集成. 就在不久前一次朋友聚会上,一个刚刚跳槽到一家创业公司的朋友跟我抱怨说他们没有CI,没有code review,要做点事太累了.而其实让这个刚刚开始上手的新手项目经理无语到吐的原因是,他们的一名主要开发人员责任心不够,很难沟通,bug率很高,还不愿加班改bug. “现在招人很难的啊,所以也不能把他fire掉,哎...” “有了CI又能怎样呢?” “至少不用等到QA发现问题,下班前就能抓住他了!不过现在我们QA连自动化测试…
Here's to the crazy ones. The misfits. The rebels. The troublemakers. The round pegs in the square holes. The ones who see things differently. They're not fond of rules And they have no respect for the status quo. You can praise them, quote them, dis…
1. General review. Professor Webster published this article in Urban Planning Forum, one of the top Chinese urban planning academic journals, before he went to take the office as Dean of the Faculty of Architecture in the University of Hong Kong. Obv…
树状数组维护DP + 高精度 Description These days, Sempr is crazed on one problem named Crazy Thair. Given N (1 ≤ N ≤ 50000) numbers, which are no more than 109, Crazy Thair is a group of 5 numbers {i, j, k, l, m} satisfying: 1 ≤ i < j < k < l < m ≤ N Ai…
Crazy Search Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 26713 Accepted: 7449 Description Many people like to solve hard puzzles some of which may lead them to madness. One such puzzle could be finding a hidden prime number in a given…
C - Crazy Calendar Time Limit:4000MS     Memory Limit:32768KB     64bit IO Format:%lld & %llu Submit Status Practice LightOJ 1393 Description 2011 was a crazy year. Many people all over the world proposed on 11-11-11, married on 11-11-11, some even w…
THE ARCHITECTURE OF COMPLEXITY HERBERT A. SIMON* Professor of Administration, Carnegie Institute of Technology (Read April 26, 1962)…