08 2013 档案

摘要:117. Countingtime limit per test: 0.5 sec. memory limit per test: 4096 KBFind amount of numbers for given sequence of integer numbers such that after raising them to the M-th power they will be divid... 阅读全文
posted @ 2013-08-31 17:59 码代码的猿猿 阅读(153) 评论(0) 推荐(0)
摘要:优先级队列,也简称优先队列,比较常用的一种数据结构。这里主要说一下用C++ STL中的priority_queue 实现。 priority_queue的概念: 如果我们给每个元素都分配一个数字来标记其优先级,不妨设较小的数字具有较高的优先级,这样我们就可以在一个集合中访问优先级最高的元素并对其进行查找和删除操作了。这样,我们就引入了优先级队列 这种数据结构。 优先级队列(p... 阅读全文
posted @ 2013-08-31 15:36 码代码的猿猿 阅读(496) 评论(0) 推荐(0)
摘要:本文主要对n个球放进m个盒子里面的问题的不同情况做了一下总结。。。 阅读全文
posted @ 2013-08-31 15:34 码代码的猿猿 阅读(235) 评论(0) 推荐(0)
摘要:Burn the Linked CampTime Limit:2 Seconds Memory Limit:65536 KBIt is well known that, in the period of The Three Empires, Liu Bei, the emperor of the Shu Empire, was defeated by Lu Xun, a general of the Wu Empire. The defeat was due to Liu Bei's wrong decision that he divided his large troops int 阅读全文
posted @ 2013-08-30 11:35 码代码的猿猿 阅读(177) 评论(0) 推荐(0)
摘要:第一: 感觉难点在于建图 第二: ①:对于差分不等式,a - b = c ,建一条 b 到 a 的权值为 c 的边,求的是最长路,得到的是最小值 ③:存在负环的话是无解 ④:求不出最短路(dist[ ]没有得到更新)的话是任意解 第三: 一种建图方法: 设x是第i位置(或时刻)的值(跟所求值的属性一样),那么把x看成数列,前n项和为s[n],则x = s - s[i-1]; 那么这样就可以最起码... 阅读全文
posted @ 2013-08-30 08:18 码代码的猿猿 阅读(119) 评论(0) 推荐(0)
摘要:IntervalsTime Limit: 2000MSMemory Limit: 65536KTotal Submissions: 19359Accepted: 7308DescriptionYou are gi... 阅读全文
posted @ 2013-08-30 08:16 码代码的猿猿 阅读(143) 评论(0) 推荐(0)
摘要:Labeling BallsTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 9221Accepted: 2510DescriptionWindy has N balls of distinct weights from 1 unit to N units. Now he tries to label them with 1 to N... 阅读全文
posted @ 2013-08-29 19:59 码代码的猿猿 阅读(167) 评论(0) 推荐(0)
摘要:Sorting It All OutTime Limit:1000MSMemory Limit:10000KTotal Submissions:24591Accepted:8517DescriptionAn ascending sorted sequence of distinct values is one in which some form of a less-than operator is used to order the elements from smallest to largest. For example, the sorted sequence A, B, C, D i 阅读全文
posted @ 2013-08-28 09:26 码代码的猿猿 阅读(159) 评论(0) 推荐(0)
摘要:“链式前向星”是我创造的(至少Baidu上没有搜到)名词,或许这种数据结构有其他更加正规易懂的名字,但我还是没有搜到。(有一个资料称之为加上next数组前向星,但这个名字实在不好)该数据结构可能是Jason911神牛或其他神牛发明的,我只是起了个名字并写了这个课件。Malash2009年10月18日0:34:50 示例程序: 71 22 33 41 3... 阅读全文
posted @ 2013-08-27 22:43 码代码的猿猿 阅读(429) 评论(0) 推荐(0)
摘要:A. Helpful Mathstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputXenia the beginner mathematician is a third year student at elementary school. She is now learning the addition operation.The teacher has written down the sum of multiple numbers. Pu 阅读全文
posted @ 2013-08-27 13:32 码代码的猿猿 阅读(713) 评论(0) 推荐(0)
摘要:KingTime Limit:1000MSMemory Limit:10000KTotal Submissions:9004Accepted:3385DescriptionOnce, in one kingdom, there was a queen and that queen was expecting a baby. The queen prayed: ``If my child was a son and if only he was a sound king.'' After nine months her child was born, a... 阅读全文
posted @ 2013-08-26 09:44 码代码的猿猿 阅读(168) 评论(0) 推荐(0)
摘要:Football Gambling IITime Limit: 3 Seconds Memory Limit: 65536 KBThe 2010 FIFA World Cup toke place between 11 June and 11 July 2010 in South Africa. Being a non-fans, asmn likes football gamblin... 阅读全文
posted @ 2013-08-25 07:58 码代码的猿猿 阅读(241) 评论(0) 推荐(0)
摘要:Beauty ContestTime Limit:3000MSMemory Limit:65536KTotal Submissions:24738Accepted:7565DescriptionBessie, Farmer John's prize cow, has just won first place in a bovine beauty contest, earning the title 'Miss Cow World'. As a result, Bessie will make a tour of N (2 2 #include 3... 阅读全文
posted @ 2013-08-24 11:27 码代码的猿猿 阅读(212) 评论(0) 推荐(0)
摘要:宇航员Time Limit:2000MSMemory Limit:30000KTotal Submissions:4126Accepted:1766Description问题描述: 宇航员在太空中迷失了方向,在他的起始位置现在建立一个虚拟xyz坐标系,称为绝对坐标系,宇航员正面的方向为x轴正方向,头顶方向为z轴正方向,则宇航员的初始状态如下图所示:现对六个方向分别标号,x,y,z正方向分别为0,1,2,负方向分别为3,4,5;称它们为绝对方向。宇航员在宇宙中只沿着与绝对坐标系xyz轴平行的方向行走,但是他不知道自己当前绝对坐标和自己... 阅读全文
posted @ 2013-08-24 00:38 码代码的猿猿 阅读(410) 评论(0) 推荐(0)
摘要:154. Factorialtime limit per test: 0.5 sec.memory limit per test: 4096 KBinput: standard inputoutput: standard outputYou task is to find minimal natural number N, so that N! contains exactly Q zeroes on the trail in decimal notation. As you know N! = 1*2*...*N. For example, 5! = 120, 120 contains on 阅读全文
posted @ 2013-08-23 22:32 码代码的猿猿 阅读(275) 评论(0) 推荐(0)
摘要:Broken NecklaceYou have a necklace of N red, white, or blue beads (3 7 #include 8 #include 9 #include 10 #include 11 12 using namespace std;13 const int INF=0x3f3f3f3f;14 15 int main()16 {17 freopen("beads.in","r",stdin);18 freopen("beads.out","w",stdout);19 2 阅读全文
posted @ 2013-08-23 09:55 码代码的猿猿 阅读(268) 评论(0) 推荐(0)
摘要:Friday the ThirteenthIs Friday the 13th really an unusual event?That is, does the 13th of the month land on a Friday less often than on any other day of the week? To answer this question, write a program that will compute the frequency that the 13th of each month lands on Sunday, Monday, Tuesday, We 阅读全文
posted @ 2013-08-23 09:54 码代码的猿猿 阅读(273) 评论(0) 推荐(0)
摘要:Greedy Gift GiversA group of NP (2 ≤ NP ≤ 10) uniquely named friends has decided to exchange gifts of money. Each of these friends might or might not give some money to any or all of the other friends. Likewise, each friend might or might not receive money from any or all of the other friends. Your 阅读全文
posted @ 2013-08-23 09:53 码代码的猿猿 阅读(247) 评论(0) 推荐(0)
摘要:Your Ride Is HereIt is a well-known fact that behind every good comet is a UFO. These UFOs often come to collect loyal supporters from here on Earth. Unfortunately, they only have room to pick up one group of followers on each trip. They do, however, let the groups know ahead of time which will be p 阅读全文
posted @ 2013-08-23 09:52 码代码的猿猿 阅读(385) 评论(0) 推荐(0)
摘要:用力过猛,撇坏了两个卡子很容易就装上去了目前的配置升级到3G内存,飞一般的感觉!!!爽http://speccy.piriform.com/results/P0uJJVgaWl0DY2fnm3AOlcJ 阅读全文
posted @ 2013-08-23 03:38 码代码的猿猿 阅读(155) 评论(0) 推荐(0)
摘要:AntsTime Limit: 2 Seconds Memory Limit: 32768 KBecho is a curious and clever girl, and she is addicted to the ants recently.She knows that the ants are divided into many levels depends on abilit... 阅读全文
posted @ 2013-08-22 04:04 码代码的猿猿 阅读(161) 评论(0) 推荐(0)
摘要:lockerTime Limit: 3000msMemory Limit: 32768KBThis problem will be judged on HDU. Original ID: 443364-bit integer IO format: %I64d Java class name: MainPrev Submit Status Statistics Discuss NextTy... 阅读全文
posted @ 2013-08-21 04:23 码代码的猿猿 阅读(270) 评论(0) 推荐(0)
摘要:Dividing a ChocolateTime Limit: 2000msMemory Limit: 65536KBThis problem will be judged on ZJU. Original ID: 270564-bit integer IO format: %lld Java class name: MainPrev Submit Status Statistics ... 阅读全文
posted @ 2013-08-20 07:17 码代码的猿猿 阅读(374) 评论(0) 推荐(0)
摘要:107. 987654321 problemtime limit per test: 0.5 sec. memory limit per test: 4096 KBFor given number N you must output amount of N-digit numbers, such, that last digits of their square is equal to 98765... 阅读全文
posted @ 2013-08-19 18:02 码代码的猿猿 阅读(170) 评论(0) 推荐(0)
摘要:The k-th Largest GroupTime Limit: 2000MSMemory Limit: 131072KTotal Submissions: 6776Accepted: 2179DescriptionNewman likes playing with cats. He possesses lots of cats in his home. Because the number o... 阅读全文
posted @ 2013-08-19 07:33 码代码的猿猿 阅读(252) 评论(0) 推荐(0)
摘要:Finding NemoTime Limit: 2000MSMemory Limit: 30000KTotal Submissions: 7006Accepted: 1612DescriptionNemo is a naughty boy. One day he went into the deep sea all by himself. Unfortunately, he became lost... 阅读全文
posted @ 2013-08-19 04:12 码代码的猿猿 阅读(198) 评论(0) 推荐(0)
摘要:105. Div 3time limit per test: 0.5 sec. memory limit per test: 4096 KBThere is sequence 1, 12, 123, 1234, ..., 12345678910, ... . Given first N elements of that sequence. You must determine amount of... 阅读全文
posted @ 2013-08-18 21:11 码代码的猿猿 阅读(142) 评论(0) 推荐(0)
摘要:HotelTime Limit: 3000MSMemory Limit: 65536KTotal Submissions: 9630Accepted: 4126DescriptionThe cows are journeying north to Thunder Bay in Canada to gain cultural enrichment and enjoy a vacation on th... 阅读全文
posted @ 2013-08-17 18:42 码代码的猿猿 阅读(186) 评论(0) 推荐(0)
摘要:Scaring the BirdsTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 889 Accepted Submission(s): 305Problem DescriptionIt’s harvest season now! ... 阅读全文
posted @ 2013-08-17 01:15 码代码的猿猿 阅读(228) 评论(0) 推荐(0)
摘要:MPI MaelstromTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 4266Accepted: 2600DescriptionBIT has recent... 阅读全文
posted @ 2013-08-16 03:42 码代码的猿猿 阅读(155) 评论(0) 推荐(0)
摘要:dijkstra。。。。。floyd。。。。。 最短路Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 22794 Accepted Submission(s): 9731Problem Description在每年的校赛里,所有进入决... 阅读全文
posted @ 2013-08-15 05:13 码代码的猿猿 阅读(136) 评论(0) 推荐(0)
摘要:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=610仅仅只是一道线段树水题。。。。。本来想根据先序遍历找线段个数。。。。但是最后越调越麻烦。。。。。。 最后改成,整个扫一遍。。。。。。Count the ColorsTime Limit: 2 Seconds Memory Limit: 65536 KBPainti... 阅读全文
posted @ 2013-08-14 20:40 码代码的猿猿 阅读(190) 评论(0) 推荐(0)
摘要:J. 鸣人的查克拉Time Limit: 1000msCase Time Limit: 1000msMemory Limit: 65536KB64-bit integer IO format: %lld Java class name: MainSubmit Status PID: 29065Font Size: + -《火影忍者》中,在忍者们使用忍术的时候,需要一定的查克拉(可以看成... 阅读全文
posted @ 2013-08-13 06:45 码代码的猿猿 阅读(294) 评论(0) 推荐(0)
摘要:硬币水题IITime Limit: 1000msMemory Limit: 65536KB64-bit integer IO format: %lld Java class name: MainPrev Submit Status Statistics Discuss NextFont Size: + -Type: None Graph Theory 2-SAT Art... 阅读全文
posted @ 2013-08-13 04:30 码代码的猿猿 阅读(269) 评论(0) 推荐(0)
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1698线段树。。。。成段更新。。。。。。。。Just a HookTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 12958 Accepted Su... 阅读全文
posted @ 2013-08-12 15:50 码代码的猿猿 阅读(153) 评论(0) 推荐(0)
摘要:传说中的传送门:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=1562More DivisorsTime Limit: 2 Seconds Memory Limit: 65536 KBEverybody knows that we use decimal notation, i.e. the base of our ... 阅读全文
posted @ 2013-08-12 08:19 码代码的猿猿 阅读(216) 评论(0) 推荐(0)
摘要:传说中的传送门:http://poj.org/problem?id=2828 Buy TicketsTime Limit: 4000MSMemory Limit: 65536KTotal Submissions: 10620Accepted: 5146DescriptionRailway tickets were difficult to buy around the Lunar New Ye... 阅读全文
posted @ 2013-08-11 23:58 码代码的猿猿 阅读(162) 评论(0) 推荐(0)
摘要:Balanced LineupTime Limit: 5000MSMemory Limit: 65536KTotal Submissions: 28725Accepted: 13519Case Time Limit: 2000MSDescriptionFor the daily milking, Farmer John's N cows (1 ≤ N ≤ 50,000) always line u... 阅读全文
posted @ 2013-08-11 22:06 码代码的猿猿 阅读(133) 评论(0) 推荐(0)
摘要:高仿NotOnlySuccess的线段树。。。。。Multiply gameTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1217 Accepted Submission(s): 408Problem DescriptionTire... 阅读全文
posted @ 2013-08-11 18:57 码代码的猿猿 阅读(157) 评论(0) 推荐(0)
摘要:C. Come to a spring outingTime Limit: 1000msCase Time Limit: 1000msMemory Limit: 65536KB64-bit integer IO format: %lld Java class name: MainSubmit Status PID: 29358Font Size: + - Spring is co... 阅读全文
posted @ 2013-08-10 21:20 码代码的猿猿 阅读(217) 评论(0) 推荐(0)
摘要:H. Hard math problemTime Limit: 2000msCase Time Limit: 2000msMemory Limit: 65536KB64-bit integer IO format: %lld Java class name: MainSubmit Status PID: 29363Font Size: + - Xioumu was trapped ... 阅读全文
posted @ 2013-08-10 17:42 码代码的猿猿 阅读(262) 评论(0) 推荐(0)
摘要:Layton's EscapeTime Limit: 2 Seconds Memory Limit: 65536 KBProfessor Layton is a renowned archaeologist from London's Gressenheller University. He and his apprentice Luke has solved various myste... 阅读全文
posted @ 2013-08-10 06:29 码代码的猿猿 阅读(177) 评论(0) 推荐(0)
摘要:Scrambled PolygonTime Limit: 2 Seconds Memory Limit: 65536 KBA closed polygon is a figure bounded by a finite number of line segments. The intersections of the bounding line segments are called t... 阅读全文
posted @ 2013-08-10 04:36 码代码的猿猿 阅读(177) 评论(0) 推荐(0)
摘要:状压DP。。。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 ... 阅读全文
posted @ 2013-08-09 08:23 码代码的猿猿 阅读(178) 评论(0) 推荐(0)
摘要:状压DPSurvivalTime Limit: 5 Seconds Memory Limit: 32768 KBThe King of Fighter 97 (KOF97) is an electronic game of wrestling type. Once it was fashionable among youths. The game is amused. However, ... 阅读全文
posted @ 2013-08-09 07:00 码代码的猿猿 阅读(240) 评论(0) 推荐(0)
摘要:#include #include #include #include using namespace std;const double eps=1e-9;double a[4][5]={{1,-1,-2,-5,10},{-2,7,6,-12,6},{3,-2,-5,-17,31},{-5,-2,9,27,-63}};double ans[10];bool l[10];int solve(doub... 阅读全文
posted @ 2013-08-08 07:29 码代码的猿猿 阅读(213) 评论(0) 推荐(0)
摘要:HyperhuffmanTime Limit: 5 Seconds Memory Limit: 32768 KBYou might have heard about Huffman encoding - that is the coding system that minimizes the expected length of the text if the codes for cha... 阅读全文
posted @ 2013-08-07 19:13 码代码的猿猿 阅读(211) 评论(0) 推荐(0)
摘要:FrecklesTime Limit: 2 Seconds Memory Limit: 65536 KBIn an episode of the Dick Van Dyke show, little Richie connects the freckles on his Dad's back to form a picture of the Liberty Bell. Alas, one... 阅读全文
posted @ 2013-08-07 18:44 码代码的猿猿 阅读(177) 评论(0) 推荐(0)
摘要:求树的直径:任选一点求BFS,所得的距离这个点最远的一定是直径上的一个距离该点较远的端点,再进行一次BFS就能找到直径。。。。。Extend 7-day VacationTime Limit: 1 Second Memory Limit: 32768 KBCYJJ is planning on her vacation. Since her boss has permitted her ... 阅读全文
posted @ 2013-08-07 17:27 码代码的猿猿 阅读(210) 评论(0) 推荐(0)
摘要:RobbersTime Limit: 5 Seconds Memory Limit: 32768 KB Special JudgeN robbers have robbed the bank. As the result of their crime they chanced to get M golden coins. Before the robbery the band ... 阅读全文
posted @ 2013-08-07 08:33 码代码的猿猿 阅读(282) 评论(0) 推荐(0)
摘要:String SuccessorTime Limit: 2 Seconds Memory Limit: 65536 KBThe successor to a string can be calculated by applying the following rules:Ignore the nonalphanumerics unless there are no alphanumeri... 阅读全文
posted @ 2013-08-07 07:26 码代码的猿猿 阅读(214) 评论(0) 推荐(0)
摘要:The HiveTime Limit: 2 Seconds Memory Limit: 65536 KBThere is a hive in the village. Like this. There are 9 columns (from A to I) in this hive. Different column may have the different number of gr... 阅读全文
posted @ 2013-08-05 23:12 码代码的猿猿 阅读(177) 评论(0) 推荐(0)
摘要:逗比的A题技巧: Move to Baggage OfficeTime Limit: 1 Second Memory Limit: 32768 KBwatashi's mm is so pretty as well as clever. When she has to move to YQ from ZJG, she turns to watashi for help to move h... 阅读全文
posted @ 2013-08-05 19:22 码代码的猿猿 阅读(203) 评论(0) 推荐(0)
摘要:Number PuzzleTime Limit: 2 Seconds Memory Limit: 65536 KBGiven a list of integers (A1, A2, ..., An), and a positive integer M, please find the number of positive integers that are not greater tha... 阅读全文
posted @ 2013-08-05 05:32 码代码的猿猿 阅读(212) 评论(0) 推荐(0)
摘要:C LooooopsTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 14925Accepted: 3767DescriptionA Compiler Mystery: We are given a C-language style for loop of type for (variable = A; variable != B; ... 阅读全文
posted @ 2013-08-03 05:22 码代码的猿猿 阅读(106) 评论(0) 推荐(0)
摘要:Find the MarbleTime Limit: 2 Seconds Memory Limit: 65536 KBAlice and Bob are playing a game. This game is played with several identical pots and one marble. When the game starts, Alice puts the p... 阅读全文
posted @ 2013-08-02 18:38 码代码的猿猿 阅读(186) 评论(0) 推荐(0)
摘要:求A,B的最大公约数,并求出X,Y A*X+B*Y=gcd(A,B)int ex_gcd(int a,int b,int &x,int &y){ if(b==0) { x=1;y=0; return a; } else { int r=gcd(b,a&b,y,x); y-=x*(a/b)... 阅读全文
posted @ 2013-08-02 08:06 码代码的猿猿 阅读(111) 评论(0) 推荐(0)
摘要:Modular InverseTime Limit: 2 Seconds Memory Limit: 65536 KBThe modular modular multiplicative inverse of an integer a modulo m is an integer x such that a-1≡x (mod m). This is equivalent to ax≡1 ... 阅读全文
posted @ 2013-08-02 07:17 码代码的猿猿 阅读(235) 评论(0) 推荐(0)
摘要:Draw Something CheatTime Limit: 2 Seconds Memory Limit: 65536 KBHave you played Draw Something? It's currently one of the hottest social drawing games on Apple iOS and Android Devices! In this ga... 阅读全文
posted @ 2013-08-02 04:10 码代码的猿猿 阅读(412) 评论(0) 推荐(0)
摘要:线段树。。。。。BillboardTime Limit: 20000/8000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 7316 Accepted Submission(s): 3278Problem DescriptionAt the entrance to the ... 阅读全文
posted @ 2013-08-01 06:08 码代码的猿猿 阅读(121) 评论(0) 推荐(0)
摘要:Minimum Inversion NumberTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 7428 Accepted Submission(s): 4560Problem DescriptionThe inversion num... 阅读全文
posted @ 2013-08-01 02:38 码代码的猿猿 阅读(165) 评论(0) 推荐(0)