摘要:Treasure MapTime Limit:2 Seconds Memory Limit:32768 KBYour boss once had got many copies of a treasure map. Unfortunately, all the copies are now brok...
阅读全文
摘要:题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3765LightsTime Limit:8 Seconds Memory Limit:131072 KBNow you haveNlights in a line. Don't worry - the lights don't have color. The only status they have is on and off. And, each light has a value, too.There is a boring student
阅读全文
摘要:Dynamic RankingsTime Limit:10 Seconds Memory Limit:32768 KBThe Company Dynamic Rankings has developed a new kind of computer that is no longer satisfied with the query like to simply find the k-th smallest number of the given N numbers. They have developed a more powerful system such that for N numb
阅读全文
摘要:BCD CodeTime Limit:5 Seconds Memory Limit:65536 KBBinary-coded decimal (BCD) is an encoding for decimal numbers in which each digit is represented by its own binary sequence. To encode a decimal number using the common BCD encoding, each decimal digit is stored in a 4-bit nibble:Decimal: 0 1 ...
阅读全文
摘要:Detect the VirusTime Limit:2 Seconds Memory Limit:65536 KBOne day, Nobita found that his computer is extremely slow. After several hours' work, he finally found that it was a virus that made his poor computer slow and the virus was activated by a misoperation of opening an attachment of an email
阅读全文
摘要:Balanced NumberTime Limit:5 Seconds Memory Limit:65536 KBA balanced number is a non-negative integer that can be balanced if a pivot is placed at some digit. More specifically, imagine each digit as a box with weight indicated by the digit. When a pivot is placed at some digit of the number, the dis
阅读全文
摘要:题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=4255DP的思路就是,如果要访问完[i,j],那么它的子区间一定访问完了。用dp[i][j][0]表示访问完区间[i,j]并留在左端点,dp[i][j][1]表示访问完区间[i,j]并留在右端点。把饭店那个地方也加进去作为点。从饭店那个点往两边进行DP;dp[i][j][0] 可以根据dp[i+1][j][0]和dp[i+1][j][1]得到。dp[i][j][1] 可以根据dp[i][j-1][0]和dp[i][j-1][1]得到。//==============
阅读全文
摘要:题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=4472开始做下区间DP的题目了。题解可以参照大牛博客:http://blog.csdn.net/woshi250hua/article/details/7824433这题很经典,主要是思路:两种写法写的,一种是DP,一种是记忆化搜索。DP一定要注意循环的顺序。代码一://============================================================================// Name : ZOJ.cp...
阅读全文
摘要:Most PowerfulTime Limit:2 Seconds Memory Limit:65536 KBRecently, researchers on Mars have discovered N powerful atoms. All of them are different. These atoms have some properties. When two of these atoms collide, one of them disappears and a lot of power is produced. Researchers know the way every t
阅读全文
摘要:Connections in Galaxy WarTime Limit:3 Seconds Memory Limit:32768 KBIn order to strengthen the defense ability, many stars in galaxy allied together and built many bidirectional tunnels to exchange messages. However, when the Galaxy War began, some tunnels were destroyed by the monsters from another
阅读全文
摘要:决定先把ZOJ上的狗狗40题刷掉了呢~~~~~IDZOJ IDTitleRatio (AC/All)10011021The Willy Memorial Program23.69% (82/346)10021030Farmland50.33% (151/300)10031041Transmitters49.30% (995/2018)10041043Split Windows52.48% (74/141)10051060Sorting It All Out29.89% (993/3322)10061063Space Station Shielding31.79% (235/739)100710
阅读全文
摘要:Split the RectangleTime Limit: 2 Seconds Memory Limit: 32768 KBAlice comes up with a new game and wants to play with Bob.There is one rectangle on the paper initially, we define its lower-left corner's coordinate is (xL, yL) and upper-right corner's coordinate is (xR, yR).Bob has executed th
阅读全文
摘要:Math MagicTime Limit: 3 Seconds Memory Limit: 32768 KBYesterday, my teacher taught us about math: +, -, *, /, GCD, LCM... As you know, LCM (Least common multiple) of two positive numbers can be solved easily because of a * b = GCD (a, b) * LCM (a, b).In class, I raised a new idea: "how to calcu
阅读全文
摘要:Conquer a New RegionTime Limit: 5 Seconds Memory Limit: 32768 KBThe wheel of the history rolling forward, our king conquered a new region in a distant continent.There are N towns (numbered from 1 to N) in this region connected by several roads. It's confirmed that there is exact one route betwee
阅读全文
摘要:Yukari's BirthdayTime Limit: 2 Seconds Memory Limit: 32768 KBToday is Yukari's n-th birthday. Ran and Chen hold a celebration party for her. Now comes the most important part, birthday cake! But it's a big challenge for them to place n candles on the top of the cake. As Yukari has lived
阅读全文
摘要:The Little Girl who Picks MushroomsTime Limit: 2 Seconds Memory Limit: 32768 KBIt's yet another festival season in Gensokyo. Little girl Alice planned to pick mushrooms in five mountains. She brought five bags with her and used different bags to collect mushrooms from different mountains. Each b
阅读全文
摘要:Bit MagicTime Limit: 8 Seconds Memory Limit: 32768 KBYesterday, my teacher taught me about bit operators: and (&), or (|), xor (^). I generated a number table a[N], and wrote a program to calculate the matrix table b[N][N] using three kinds of bit operator. I thought my achievement would get tea
阅读全文
摘要:Help Me EscapeTime Limit: 2 Seconds Memory Limit: 32768 KBBackgroundIf thou doest well, shalt thou not be accepted? and if thou doest not well, sin lieth at the door. And unto thee shall be his desire, and thou shalt rule over him. And Cain talked with Abel his brother: and it came to pass, when th.
阅读全文
摘要:Patchouli's Spell CardsTime Limit: 7 Seconds Memory Limit: 65536 KBPatchouli Knowledge, the unmoving great library, is a magician who has settled down in the Scarlet Devil Mansion (紅魔館). Her specialty is elemental magic employing the seven elements fire, water, wood, metal, earth, sun, and moon.
阅读全文
摘要:MissileTime Limit: 2 Seconds Memory Limit: 65536 KBYou control N missile launching towers. Every tower has enough missiles, but for each tower only one missile can be launch at the same time. Before the launching, every missile need T1 seconds to leave the tower. Assume that all the missiles have t.
阅读全文