摘要:
Radar Installation Description Assume the coasting is an infinite straight line. Land is in one side of coasting, sea in the other. Each small island 阅读全文
摘要:
The Pilots Brothers' refrigerator Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 17598 Accepted: 6660 Special Judge Description The game “ 阅读全文
摘要:
A Knight's JourneyTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 28630Accepted: 9794DescriptionBackground The knight is getting bored of see... 阅读全文
摘要:
声明:以下文章是借鉴了别人的再加上自己补充后的,转载请注明!一、同余对于整数除以某个正整数的问题,如果只关心余数的情况,就产生同余的概念。定义1 用给定的正整数m分别除整数a、b,如果所得的余数相等,则称a、b对模m同余,记作a≡b(mod m),如 56≡0 (mod 8)。举个例子:3%2=15... 阅读全文
摘要:
其实很多算法的优化是很多的,只有想不到,没有做不到。大家看了上一篇博客关于素数的筛选求法,其实上一篇博客里的方法其实是还可以在优化的,因为在排除的时候还是有很多重判的情况,一下的优化可以避免重判的情况。原理:1. 任何一个合数都可以表示成一个质数和一个数的乘积2. 假设A是一个合数,且A = x *... 阅读全文
摘要:
★引言 昨天做一道数论的题,无意中接触到了关于筛法快速求素数的题目,就搞了一下关于素数的知识,大家都知道,数论其实和素数关系是非常紧密的。 ★题目 下面我就由浅入深,从各种角度来剖析这道题目的奥妙。 为了避免被人指责为"玩文字游戏"(有些同学自己审题不细,却... 阅读全文
摘要:
B. Prison TransferThe prison of your city has n prisoners. As the prison can't accommodate all of them, the city mayor has decided to transfer c of th... 阅读全文
摘要:
A. Police RecruitsThe police department of your city has just started its journey. Initially, they don’t have any manpower. So, they started hiring ne... 阅读全文
摘要:
Buy TicketsTime Limit:4000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u DescriptionRailway tickets were difficult to buy around the Lunar New ... 阅读全文
摘要:
Minimum Inversion Number Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Description The inversion number of a given number seque... 阅读全文
摘要:
A - 敌兵布阵 Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Description C国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国在海岸线沿直线布置... 阅读全文
摘要:
I Hate It Time Limit:3000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Description 很多学校流行一种比较的习惯。老师们很喜欢询问,从某某到某某当中,分数最高的是多少。 这让很多学生很反感。 ... 阅读全文
摘要:
Billboard Time Limit:8000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Description At the entrance to the university, there is a huge rectangu... 阅读全文
摘要:
Carmichael Numbers (Uva 10006)An important topic nowadays in computer science is cryptography. Some people even think that cryptography is the only i... 阅读全文