Live2d Test Env

随笔分类 -  CodeForces

上一页 1 ··· 3 4 5 6 7 8 9 下一页
摘要:Mrs. Smith is trying to contact her husband, John Smith, but she forgot the secret phone number! The only thing Mrs. Smith remembered was that any per 阅读全文
posted @ 2018-08-15 09:36 nimphy 阅读(236) 评论(0) 推荐(0)
摘要:Notice: unusual memory limit! After the war, destroyed cities in the neutral zone were restored. And children went back to school. The war changed the 阅读全文
posted @ 2018-08-14 21:50 nimphy 阅读(215) 评论(0) 推荐(0)
摘要:题意:给定一个N,让你把它拆成若干个只含素因子2和3的数之和,且两两之间没有倍数关系,比如10=4+6。 思路:即是2因子的幂递增,3因子的幂递减;或者反之。 对于当前N,我们拆分出的数为num=2^x*3^y;满足2^x|N,而且y最大,然后把继续拆分N-num。不难推出,N-num是个偶数,且至 阅读全文
posted @ 2018-08-14 09:34 nimphy 阅读(313) 评论(0) 推荐(0)
摘要:题意: 一个宽度为N的网格图,i上有h[i]高的方块。现在你有W个方块,问怎么放使得最终的最高点最高。 当一个格子的下方,左下方和右下方都有方块那么久可以把方块放到这个格子上。最左端和最右端不能放方块。 (N<=100000,W<=1018,h[i]<=109) 思路:显然是二分,对于二分的高度Mi 阅读全文
posted @ 2018-08-13 20:56 nimphy 阅读(483) 评论(0) 推荐(0)
摘要:题意:现在有函数,每一项Xi=(A*X(i-1)+B)%C。现在给定N个函数以及K:X0,A,B,C。然你再每个函数选择一个数,使得其和最大,而且不被K整除。 X0,A,B,C<=1e3 ;K<=1e9 思路:因为C比较小,我们可以找到循环节(不一定是从0开始就循环了,所以用vis判定是否出现过)。 阅读全文
posted @ 2018-08-13 09:58 nimphy 阅读(299) 评论(0) 推荐(0)
摘要:题意:给定长度为N的01串,现在让你猜这个串,猜的次数要不超过N+500次。 每次你猜一个串,系统会返回N/2,或N,或0。当且当有N/2个位置猜对,N个位置猜对,其他。 思路:因为信息不多,没有关联性,所以前期只有瞎猜,直到猜到一个N/2,(如果是N也ok)。猜到N/2之后,我们从这个N/2串考虑 阅读全文
posted @ 2018-08-13 08:31 nimphy 阅读(290) 评论(0) 推荐(0)
摘要:题意:给定一个N点M边的有向图,叫你加最多K条边,使得最小拓扑序最大. 思路:不是那么简单的题. 参照了别人的代码, 最后想通了. 贪心原则: 用两个单调队列维护, 第一个序列S1单增, 表示当前入度为0的点 ; 第二个序列S2单减,表示需要加边的点. 如果S1的最大值大于S2的最大值,则对其加边. 阅读全文
posted @ 2018-08-12 11:38 nimphy 阅读(321) 评论(0) 推荐(0)
摘要:题意: 现在有1,2,3...N这N个站, 给定限定时间Limt, N-1种票的价格, 分别对应一个最远距离, 叫你选择一种票, 满足可以在规定时间到达N站台,而且价格最低 思路: 如果买距离为L的票可以在规定时间到,那么距离>L的票也一定能到. 我们只需要二分出这个下界 L,然后在>=L里选择一个 阅读全文
posted @ 2018-08-11 19:18 nimphy 阅读(339) 评论(0) 推荐(0)
摘要:题意:给定X,Y,分别表示由'.'和'@'组成的连通块的个数。 思路:假如X<Y,我们用两部分来构造这个结果,第一部分由一个'.'连通块和Y-(X-1)割'@'连通块组成,第二个部分由X-1个'.'连通块和X-1个'@'连通块组成. 其他情况同理. 阅读全文
posted @ 2018-08-11 19:12 nimphy 阅读(323) 评论(0) 推荐(0)
摘要:题意:给定一个凸包,现在让你连接凸包上两点,把凸包变为两个多边形,满足两个多边形的面积都是整数。 思路:我们知道整点的三角形面积S=叉积/2,则S要么是整数,要么是整数+0.5。那么多边形有多个三角形组成=So01+So12+So23+...(o是原点),也有这样的性质。因此,我们现在在算面积的时候 阅读全文
posted @ 2018-08-11 10:54 nimphy 阅读(573) 评论(0) 推荐(0)
摘要:题意:现在有一棵树,1号节点是水源,叶子节点是村庄,现在有些怪兽会占领一些村庄(即只占领叶子节点),现在要割去一些边,使得怪兽到不了水源。给出怪兽占领和离开的情况,现在要割每次回答最小的割,使得怪兽不与1号节点有联系,而且满足被阻隔的村庄最少。输出最小割与组少的被误伤的村庄。 思路:把与一号节点相邻 阅读全文
posted @ 2018-08-10 22:16 nimphy 阅读(328) 评论(1) 推荐(0)
摘要:题意:N个人,每个人有a属性和b属性,如果一个人的a或者b大于另外一个人,我们说这个人可以打败那个人。且这种关系可以传递。对于每个人,输出他可以打败多少人。(保证每个a不相同,保证每个b不相同。 思路:对于a关系,我们按重小到大连边,b同理。然后每个点能到的点就是可以打败的点。即是缩点后乱搞。 (此 阅读全文
posted @ 2018-08-10 22:01 nimphy 阅读(468) 评论(0) 推荐(0)
摘要:A string a of length m is called antipalindromic iff m is even, and for each i (1 ≤ i ≤ m) ai ≠ am - i + 1. Ivan has a string s consisting of n lowerc 阅读全文
posted @ 2018-08-03 09:39 nimphy 阅读(384) 评论(0) 推荐(0)
摘要:You are given an integer sequence a1,a2,…,ana1,a2,…,an. Find the number of pairs of indices (l,r)(l,r) (1≤l≤r≤n1≤l≤r≤n) such that the value of median 阅读全文
posted @ 2018-07-10 21:15 nimphy 阅读(309) 评论(0) 推荐(0)
摘要:Ari the monster is not an ordinary monster. She is the hidden identity of Super M, the Byteforces’ superhero. Byteforces is a country that consists of 阅读全文
posted @ 2018-07-08 19:21 nimphy 阅读(363) 评论(0) 推荐(0)
摘要:Meanwhile, the kingdom of K is getting ready for the marriage of the King's daughter. However, in order not to lose face in front of the relatives, th 阅读全文
posted @ 2018-07-08 10:49 nimphy 阅读(395) 评论(0) 推荐(0)
摘要:Barney was hanging out with Nora for a while and now he thinks he may have feelings for her. Barney wants to send her a cheesy text message and wants 阅读全文
posted @ 2018-07-01 18:37 nimphy 阅读(349) 评论(0) 推荐(0)
摘要:What-The-Fatherland is a strange country! All phone numbers there are strings consisting of lowercase English letters. What is double strange that a p 阅读全文
posted @ 2018-07-01 14:14 nimphy 阅读(644) 评论(0) 推荐(0)
摘要:The best programmers of Embezzland compete to develop a part of the project called "e-Government" — the system of automated statistic collecting and p 阅读全文
posted @ 2018-06-30 22:40 nimphy 阅读(479) 评论(0) 推荐(0)

上一页 1 ··· 3 4 5 6 7 8 9 下一页