随笔分类 - 贪心
摘要:There are N schedules, the i-th schedule has start time s i si and end time e i ei (1 <= i <= N). There are some machines. Each two overlapping schedu
阅读全文
摘要:XOR is a kind of bit operator, we define that as follow: for two binary base number A and B, let C=A XOR B, then for each bit of C, we can get its val
阅读全文
摘要:相传,在远古时期,位于西方大陆的 Magic Land 上,人们已经掌握了用魔法矿石炼制法杖的技术。那时人们就认识到,一个法杖的法力取决于使用的矿石。一般地,矿石越多则法力越强,但物极必反:有时,人们为了获取更强的法力而使用了很多矿石,却在炼制过程中发现魔法矿石全部消失了,从而无法炼制出法杖,这个现
阅读全文
摘要:Oleg the client and Igor the analyst are good friends. However, sometimes they argue over little things. Recently, they started a new company, but the
阅读全文
摘要:题意:给定N的棒棒,K种颜色,每个棒棒的两端可以涂色。现在已知所有的线段要么有一端涂色,要么两端都没有涂色,现在要求把所有的没涂色的部分涂色,使得我们可以把涂色后的棒棒分为N/K组,每组的涂色情况相同。 思路:把没有颜色的棒子,看成一端涂色为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
阅读全文
摘要: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
阅读全文
摘要:For a vector →v=(x,y)v→=(x,y), define |v|=√x2+y2|v|=x2+y2. Allen had a bit too much to drink at the bar, which is at the origin. There are nn vectors
阅读全文
摘要:One of DB and TN common interests is traveling. One day, they went to Grand Line and found One Piece ! The One Piece treasure has n gold coins (n is e
阅读全文
摘要:Special Thanks: Jane Alam Jan*At moment in University of Texas at San Antonio - USA You will be given n integers A1A2A3...An. Find a permutation of th
阅读全文
摘要:Shadowman loves to collect box but his roommates woogieman and itman don't like box and so shadowman wants to hide boxes as many as possible. A box ca
阅读全文
摘要:Problem statement: A string is said to be “PATHETIC” if all the characters in it are repeated the same number of times. You are given a string of leng
阅读全文
摘要:ultmaster 男神和小迷妹们玩起了捉迷藏的游戏。 小迷妹们都希望自己被 ultmaster 男神发现,因此她们都把自己位置告诉了 ultmaster 男神,因此 ultmaster 男神知道了自己去找每个小迷妹所要花的时间。 已知发现第 i 小迷妹得到的分数为 ai⋅tr(tr 为游戏剩余时间
阅读全文
摘要:Waca loves maths,.. a lot. He always think that 1 is an unique number. After playing in hours, Waca suddenly realize that every integer can be represe
阅读全文
摘要:ps:感觉比昨天晚上的华师题目质量高一点,至少emmm,题面没有那么多bug。 下面忽略了水题,只给出我觉得有价值的几个题目的题解和代码: 【C:神山神石】: 题意: 每一天,Wells可以喂神山一个神石,使得神山的高度变为原高度乘上神石的能力值,或者使得所有的神石能力值+1。第 0 天时,所有神石
阅读全文
摘要:FJ is about to take his N (1 ≤ N ≤ 2,000) cows to the annual"Farmer of the Year" competition. In this contest every farmer arranges his cows in a line
阅读全文
摘要:Ivan has n different boxes. The first of them contains some balls of n different colors. Ivan wants to play a strange game. He wants to distribute the
阅读全文
摘要:描述 有n个小朋友需要接水,其中第i个小朋友接水需要ai分钟。 由于水龙头有限,小Hi需要知道如果为第l个到第r个小朋友分配一个水龙头,如何安排他们的接水顺序才能使得他们等待加接水的时间总和最小。 小Hi总共会有m次询问,你能帮助他解决这个问题吗? 假设3个小朋友接水的时间分别是2,3,4。如果他们
阅读全文
摘要:A new web-design studio, called SMART (Simply Masters of ART), employs two people. The first one is a web-designer and an executive director at the sa
阅读全文
摘要:一:解决XOR常用的方法: 在vjudge上面输入关键词xor,然后按照顺序刷了一些题。 然后大概悟出了一些的的套路: 我是分界线 POJ 3764: The xor-longest 字典树求最大异或 POJ 3764: The xor-longest 字典树求最大异或 #include<cmath
阅读全文

浙公网安备 33010602011771号