3734 -- Blocks Panda has received an assignment of painting a line of blocks. Since Panda is such an...

Please Visit: http://ift.tt/1ajReyV



3734 -- Blocks



Panda has received an assignment of painting a line of blocks. Since Panda is such an intelligent boy, he starts to think of a math problem of painting. Suppose there are N blocks in a line and each block can be paint red, blue, green or yellow. For some myterious reasons, Panda want both the number of red blocks and green blocks to be even numbers. Under such conditions, Panda wants to know the number of different ways to paint these blocks.

http://ift.tt/WkxbjV

http://ift.tt/1vUKhne



3734 -- Blocks







from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/1vUKeIb

via LifeLong Community

Problem - 3555 The counter-terrorists found a time bomb in the dust. But this time the terrorists improve...

Please Visit: http://ift.tt/1ajReyV



Problem - 3555

The counter-terrorists found a time bomb in the dust. But this time the terrorists improve on the time bomb. The number sequence of the time bomb counts from 1 to N. If the current number sequence includes the sub-sequence "49", the power of the blast would add one point.

Now the counter-terrorist knows the number N. They want to know the final points of the power. Can you help them?

http://ift.tt/1t4Z7D2

http://ift.tt/1t4Z9L4



Problem - 3555







from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/1lD4BGl

via LifeLong Community

Problem - 148D - Codeforces The dragon and the princess are arguing about what to do on the New Year's...

Please Visit: http://ift.tt/1ajReyV



Problem - 148D - Codeforces



The dragon and the princess are arguing about what to do on the New Year's Eve. The dragon suggests flying to the mountains to watch fairies dancing in the moonlight, while the princess thinks they should just go to bed early. They are desperate to come to an amicable agreement, so they decide to leave this up to chance.

They take turns drawing a mouse from a bag which initially contains w white and b black mice. The person who is the first to draw a white mouse wins. After each mouse drawn by the dragon the rest of mice in the bag panic, and one of them jumps out of the bag itself (the princess draws her mice carefully and doesn't scare other mice). Princess draws first. What is the probability of the princess winning?

If there are no more mice in the bag and nobody has drawn a white mouse, the dragon wins. Mice which jump out of the bag themselves are not considered to be drawn (do not define the winner). Once a mouse has left the bag, it never returns to it. Every mouse is drawn from the bag with the same probability as every other one, and every mouse jumps out of the bag with the same probability as every other one.

http://ift.tt/Yf0FkM

http://ift.tt/1Abei04



Problem - 148D - Codeforces







from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/Yf0DJI

via LifeLong Community

3071 -- Football Consider a single-elimination football tournament involving 2n teams, denoted 1, 2...

Please Visit: http://ift.tt/1ajReyV



3071 -- Football



Consider a single-elimination football tournament involving 2n teams, denoted 1, 2, …, 2n. In each round of the tournament, all teams still in the tournament are placed in a list in order of increasing index. Then, the first team in the list plays the second team, the third team plays the fourth team, etc. The winners of these matches advance to the next round, and the losers are eliminated. After n rounds, only one team remains undefeated; this team is declared the winner.

Given a matrix P = [pij] such that pij is the probability that team i will beat team j in a match determine which team is most likely to win the tournament.

http://ift.tt/1sTXt8e

http://ift.tt/1vTd6jY



3071 -- Football







from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/Wi7S28

via LifeLong Community

3744 -- Scout YYF I YYF is a couragous scout. Now he is on a dangerous mission which is to penetrate...

Please Visit: http://ift.tt/1ajReyV



3744 -- Scout YYF I

YYF is a couragous scout. Now he is on a dangerous mission which is to penetrate into the enemy's base. After overcoming a series difficulties, YYF is now at the start of enemy's famous "mine road". This is a very long road, on which there are numbers of mines. At first, YYF is at step one. For each step after that, YYF will walk one step with a probability of p, or jump two step with a probality of 1-p. Here is the task, given the place of each mine, please calculate the probality that YYF can go through the "mine road" safely.

http://ift.tt/1qraVkg

http://ift.tt/WhuQGF



3744 -- Scout YYF I







from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/1qraXJ1

via LifeLong Community

2377 -- Bad Cowtractors Bessie has been hired to build a cheap internet network among Farmer John's ...

Please Visit: http://ift.tt/1ajReyV



2377 -- Bad Cowtractors

Bessie has been hired to build a cheap internet network among Farmer John's N (2 <= N <= 1,000) barns that are conveniently numbered 1..N. FJ has already done some surveying, and found M (1 <= M <= 20,000) possible connection routes between pairs of barns. Each possible connection route has an associated cost C (1 <= C <= 100,000). Farmer John wants to spend the least amount on connecting the network; he doesn't even want to pay Bessie.

Realizing Farmer John will not pay her, Bessie decides to do the worst job possible. She must decide on a set of connections to install so that (i) the total cost of these connections is as large as possible, (ii) all the barns are connected together (so that it is possible to reach any barn from any other barn via a path of installed connections), and (iii) so that there are no cycles among the connections (which Farmer John would easily be able to detect). Conditions (ii) and (iii) ensure that the final set of connections will look like a "tree".

http://ift.tt/1pJFItw

http://ift.tt/WcJpep



2377 -- Bad Cowtractors







from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/1pJFFOw

via LifeLong Community

1258 -- Agri-Net Farmer John has been elected mayor of his town! One of his campaign promises was to...

Please Visit: http://ift.tt/1ajReyV



1258 -- Agri-Net

Farmer John has been elected mayor of his town! One of his campaign promises was to bring internet connectivity to all farms in the area. He needs your help, of course.

Farmer John ordered a high speed connection for his farm and is going to share his connectivity with the other farmers. To minimize cost, he wants to lay the minimum amount of optical fiber to connect his farm to all the other farms.

Given a list of how much fiber it takes to connect each pair of farms, you must find the minimum amount of fiber needed to connect them all together. Each farm must connect to some other farm such that a packet can flow from any one farm to any other farm.

http://ift.tt/KKnA0z

http://ift.tt/1pJFFy7



1258 -- Agri-Net







from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/WcJoY3

via LifeLong Community

AIZU ONLINE JUDGE King Mercer is the king of ACM kingdom. There are one capital and some cities in ...

Please Visit: http://ift.tt/1ajReyV



AIZU ONLINE JUDGE



King Mercer is the king of ACM kingdom. There are one capital and some cities in his kingdom.

Amazingly, there are no roads in the kingdom now. Recently, he planned to construct roads

between the capital and the cities, but it turned out that the construction cost of his plan is

much higher than expected.

In order to reduce the cost, he has decided to create a new construction plan by removing some

roads from the original plan. However, he believes that a new plan should satisfy the following

conditions:

For every pair of cities, there is a route (a set of roads) connecting them.

The minimum distance between the capital and each city does not change from his original

plan.

Many plans may meet the conditions above, but King Mercer wants to know the plan with

minimum cost. Your task is to write a program which reads his original plan and calculates the

cost of a new plan with the minimum cost.

http://ift.tt/Wc8pmd

http://ift.tt/1roQjtb



AIZU ONLINE JUDGE







from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/Wc8qGJ

via LifeLong Community

3268 -- Silver Cow Party One cow from each of N farms (1 ≤ N ≤ 1000) conveniently numbered 1..N is ...

Please Visit: http://ift.tt/1ajReyV



3268 -- Silver Cow Party



One cow from each of N farms (1 ≤ N ≤ 1000) conveniently numbered 1..N is going to attend the big cow party to be held at farm #X (1 ≤ X ≤ N). A total of M (1 ≤ M ≤ 100,000) unidirectional (one-way roads connects pairs of farms; road i requires Ti (1 ≤ Ti ≤ 100) units of time to traverse.

Each cow must walk to the party and, when the party is over, return to her farm. Each cow is lazy and thus picks an optimal route with the shortest time. A cow's return route might be different from her original route to the party since roads are one-way.

Of all the cows, what is the longest amount of time a cow must spend walking to the party and back?

http://ift.tt/1kNY2PU

http://ift.tt/1roQjcC



3268 -- Silver Cow Party







from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/Wc8pm5

via LifeLong Community

3259 -- Wormholes While exploring his many farms, Farmer John has discovered a number of amazing wormholes...

Please Visit: http://ift.tt/1ajReyV



3259 -- Wormholes



While exploring his many farms, Farmer John has discovered a number of amazing wormholes. A wormhole is very peculiar because it is a one-way path that delivers you to its destination at a time that is BEFORE you entered the wormhole! Each of FJ's farms comprises N (1 ≤ N ≤ 500) fields conveniently numbered 1..N, M (1 ≤ M ≤ 2500) paths, and W (1 ≤ W ≤ 200) wormholes.

As FJ is an avid time-traveling fan, he wants to do the following: start at some field, travel through some paths and wormholes, and return to the starting field a time before his initial departure. Perhaps he will be able to meet himself :) .

To help FJ find out whether this is possible or not, he will supply you with complete maps to F (1 ≤ F ≤ 5) of his farms. No paths will take longer than 10,000 seconds to travel and no wormhole can bring FJ back in time by more than 10,000 seconds.

http://ift.tt/KM7l2U

http://ift.tt/1roQhS5



3259 -- Wormholes







from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/Wc8p5E

via LifeLong Community

2139 -- Six Degrees of Cowvin Bacon The cows have been making movies lately, so they are ready to play...

Please Visit: http://ift.tt/1ajReyV



2139 -- Six Degrees of Cowvin Bacon

The cows have been making movies lately, so they are ready to play a variant of the famous game "Six Degrees of Kevin Bacon".

The game works like this: each cow is considered to be zero degrees of separation (degrees) away from herself. If two distinct cows have been in a movie together, each is considered to be one 'degree' away from the other. If a two cows have never worked together but have both worked with a third cow, they are considered to be two 'degrees' away from each other (counted as: one degree to the cow they've worked with and one more to the other cow). This scales to the general case.

The N (2 <= N <= 300) cows are interested in figuring out which cow has the smallest average degree of separation from all the other cows. excluding herself of course. The cows have made M (1 <= M <= 10000) movies and it is guaranteed that some relationship path exists between every pair of cows.

http://ift.tt/1kNY36k

http://ift.tt/Wc8oP5



2139 -- Six Degrees of Cowvin Bacon







from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/Wc8nuy

via LifeLong Community

3169 -- Layout Like everyone else, cows like to stand close to their friends when queuing for feed. ...

Please Visit: http://ift.tt/1ajReyV



3169 -- Layout

Like everyone else, cows like to stand close to their friends when queuing for feed. FJ has N (2 <= N <= 1,000) cows numbered 1..N standing along a straight line waiting for feed. The cows are standing in the same order as they are numbered, and since they can be rather pushy, it is possible that two or more cows can line up at exactly the same location (that is, if we think of each cow as being located at some coordinate on a number line, then it is possible for two or more cows to share the same coordinate).

Some cows like each other and want to be within a certain distance of each other in line. Some really dislike each other and want to be separated by at least a certain distance. A list of ML (1 <= ML <= 10,000) constraints describes which cows like each other and the maximum distance by which they may be separated; a subsequent list of MD constraints (1 <= MD <= 10,000) tells which cows dislike each other and the minimum distance by which they must be separated.

Your job is to compute, if possible, the maximum possible distance between cow 1 and cow N that satisfies the distance constraints.

http://ift.tt/1n6xcl1

http://ift.tt/1umO1LB



3169 -- Layout







from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/1CpXtSN

via LifeLong Community

3723 -- Conscription Windy has a country, and he wants to build an army to protect his country. He has...

Please Visit: http://ift.tt/1ajReyV



3723 -- Conscription

Windy has a country, and he wants to build an army to protect his country. He has picked up N girls and M boys and wants to collect them to be his soldiers. To collect a soldier without any privilege, he must pay 10000 RMB. There are some relationships between girls and boys and Windy can use these relationships to reduce his cost. If girl x and boy y have a relationship d and one of them has been collected, Windy can collect the other one with 10000-d RMB. Now given all the relationships between girls and boys, your assignment is to find the least amount of money Windy has to pay. Notice that only one relationship can be used when collecting one soldier.

http://ift.tt/1f6rwjx

http://ift.tt/1umO2it



3723 -- Conscription







from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/1umO2iz

via LifeLong Community

3255 -- Roadblocks Bessie has moved to a small farm and sometimes enjoys returning to visit one of ...

Please Visit: http://ift.tt/1ajReyV



3255 -- Roadblocks



Bessie has moved to a small farm and sometimes enjoys returning to visit one of her best friends. She does not want to get to her old home too quickly, because she likes the scenery along the way. She has decided to take the second-shortest rather than the shortest path. She knows there must be some second-shortest path.

The countryside consists of R (1 ≤ R ≤ 100,000) bidirectional roads, each linking two of the N (1 ≤ N ≤ 5000) intersections, conveniently numbered 1..N. Bessie starts at intersection 1, and her friend (the destination) is at intersection N.

The second-shortest path may share roads with any of the shortest paths, and it may backtrack i.e., use the same road or intersection more than once. The second-shortest path is the shortest path whose length is longer than the shortest path(s) (i.e., if two or more shortest paths exist, the second-shortest path is the one whose length is longer than those but no longer than any other path).

http://ift.tt/1fIWfDh

http://ift.tt/1CpXtlS



3255 -- Roadblocks







from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/1umO0Ho

via LifeLong Community

03.09.2014 12:02

Please Visit: http://ift.tt/1ajReyV





Best of YouTube. Popular on YouTube · Music · Sports · Gaming · Education · Movies · TV Shows · News · Spotlight · Browse channels. Sign in now to see your channels and recommendations! Sign In. Watch Queue. TV Queue. Watch QueueTV Queue. Remove all; Disconnect. Loading... Watch Queue. TV Queue ...







from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/1tt8wYT

via LifeLong Community

Dynamic Programming | Set 16 (Floyd Warshall Algorithm) - GeeksforGeeks The Floyd Warshall Algorithm...

Please Visit: http://ift.tt/1ajReyV



Dynamic Programming | Set 16 (Floyd Warshall Algorithm) - GeeksforGeeks

The Floyd Warshall Algorithm (Link->http://ift.tt/1lHsUTS) is for solving the All Pairs Shortest Path problem. The problem is to find shortest distances between every pair of vertices in a given edge weighted directed Graph.

http://ift.tt/Wa3cea

http://ift.tt/1lHsUTU



Dynamic Programming | Set 16 (Floyd Warshall Algorithm) - GeeksforGeeks







from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/Wa3cee

via LifeLong Community

Dynamic Programming | Set 23 (Bellman–Ford Algorithm) - GeeksforGeeks Given a graph and a source vertex...

Please Visit: http://ift.tt/1ajReyV



Dynamic Programming | Set 23 (Bellman–Ford Algorithm) - GeeksforGeeks

Given a graph and a source vertex src in graph, find shortest paths from src to all vertices in the given graph. The graph may contain negative weight edges.

http://ift.tt/1lHsX1Z

http://ift.tt/Wa3die



Dynamic Programming | Set 23 (Bellman–Ford Algorithm) - GeeksforGeeks







from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/1lHsX21

via LifeLong Community

2492 -- A Bug's Life Background Professor Hopper is researching the sexual behavior of a rare species...

Please Visit: http://ift.tt/1ajReyV



2492 -- A Bug's Life

Background

Professor Hopper is researching the sexual behavior of a rare species of bugs. He assumes that they feature two different genders and that they only interact with bugs of the opposite gender. In his experiment, individual bugs and their interactions were easy to identify, because numbers were printed on their backs.

Problem

Given a list of bug interactions, decide whether the experiment supports his assumption of two genders with no homosexual bugs or if it contains some bug interactions that falsify it.

http://ift.tt/W9fELt

http://ift.tt/1pGzOth



2492 -- A Bug's Life







from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/1pGzOtj

via LifeLong Community

1308 -- Is It A Tree? A tree is a well-known data structure that is either empty (null, void, nothing...

Please Visit: http://ift.tt/1ajReyV



1308 -- Is It A Tree?

A tree is a well-known data structure that is either empty (null, void, nothing) or is a set of one or more nodes connected by directed edges between nodes satisfying the following properties.

There is exactly one node, called the root, to which no directed edges point.

Every node except the root has exactly one edge pointing to it.

There is a unique sequence of directed edges from the root to each node.

For example, consider the illustrations below, in which nodes are represented by circles and edges are represented by lines with arrowheads. The first two of these are trees, but the last is not.

http://ift.tt/1h1OL4O

http://ift.tt/1pGzQRS



1308 -- Is It A Tree?







from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/W9fCU1

via LifeLong Community

AIZU ONLINE JUDGE Problem F: Marked Ancestor You are given a tree T that consists of N nodes. Each node...

Please Visit: http://ift.tt/1ajReyV



AIZU ONLINE JUDGE

Problem F: Marked Ancestor

You are given a tree T that consists of N nodes. Each node is numbered from 1 to N, and node 1 is always the root node of T. Consider the following two operations on T:

M v: (Mark) Mark node v.

Q v: (Query) Print the index of the nearest marked ancestor of node v which is nearest to it. Initially, only the root node is marked.

Your job is to write a program that performs a sequence of these operations on a given tree and calculates

the value that each Q operation will print. To avoid too large output file, your program is requested to

print the sum of the outputs of all query operations. Note that the judges confirmed that it is possible to

calculate every output of query operations in a given sequence.

http://ift.tt/W9fEv2

http://ift.tt/W9fEv3



AIZU ONLINE JUDGE







from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/1pGzOcR

via LifeLong Community

2236 -- Wireless Network An earthquake takes place in Southeast Asia. The ACM (Asia Cooperated Medical...

Please Visit: http://ift.tt/1ajReyV



2236 -- Wireless Network

An earthquake takes place in Southeast Asia. The ACM (Asia Cooperated Medical team) have set up a wireless network with the lap computers, but an unexpected aftershock attacked, all computers in the network were all broken. The computers are repaired one by one, and the network gradually began to work again. Because of the hardware restricts, each computer can only directly communicate with the computers that are not farther than d meters from it. But every computer can be regarded as the intermediary of the communication between two other computers, that is to say computer A and computer B can communicate if computer A and computer B can communicate directly or there is a computer C that can communicate with both A and B.

In the process of repairing the network, workers can take two kinds of operations at every moment, repairing a computer, or testing if two computers can communicate. Your job is to answer all the testing operations.

http://ift.tt/1isUoqY

http://ift.tt/W9fEey



2236 -- Wireless Network







from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/1pGzOcE

via LifeLong Community

The 7 Habits of Highly Effective People: Powerful Lessons in Personal Change by Stephen Covey

Please Visit: http://ift.tt/1ajReyV



The 7 Habits of Highly Effective People: Powerful Lessons in Personal Change by Stephen Covey



The 7 Habits of Highly Effective People: Powerful Lessons in Personal Change by Stephen Covey







from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/1riuhZa

via LifeLong Community

The 7 Habits of Highly Effective People

Please Visit: http://ift.tt/1ajReyV



The 7 Habits of Highly Effective People



The 7 Habits of Highly Effective People - Part 1







from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/1w4jK49

via LifeLong Community

1703 -- Find them, Catch them The police office in Tadu City decides to say ends to the chaos, as launch...

Please Visit: http://ift.tt/1ajReyV



1703 -- Find them, Catch them

The police office in Tadu City decides to say ends to the chaos, as launch actions to root up the TWO gangs in the city, Gang Dragon and Gang Snake. However, the police first needs to identify which gang a criminal belongs to. The present question is, given two criminals; do they belong to a same clan? You must give your judgment based on incomplete information. (Since the gangsters are always acting secretly.)

Assume N (N <= 10^5) criminals are currently in Tadu City, numbered from 1 to N. And of course, at least one of them belongs to Gang Dragon, and the same for Gang Snake. You will be given M (M <= 10^5) messages in sequence, which are in the following two kinds:

1. D [a] [b]

where [a] and [b] are the numbers of two criminals, and they belong to different gangs.

2. A [a] [b]

where [a] and [b] are the numbers of two criminals. This requires you to decide whether a and b belong to a same gang.

http://ift.tt/1hOlWIH

http://ift.tt/1riuhbB



1703 -- Find them, Catch them







from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/1w4jJNR

via LifeLong Community

2524 -- Ubiquitous Religions There are so many different religions in the world today that it is difficult...

Please Visit: http://ift.tt/1ajReyV



2524 -- Ubiquitous Religions

There are so many different religions in the world today that it is difficult to keep track of them all. You are interested in finding out how many different religions students in your university believe in.

You know that there are n students in your university (0 < n <= 50000). It is infeasible for you to ask every student their religious beliefs. Furthermore, many students are not comfortable expressing their beliefs. One way to avoid these problems is to ask m (0 <= m <= n(n-1)/2) pairs of students and ask them whether they believe in the same religion (e.g. they may know if they both attend the same church). From this data, you may not know what each person believes in, but you can get an idea of the upper bound of how many different religions can be possibly represented on campus. You may assume that each student subscribes to at most one religion.

http://ift.tt/W82i1J

http://ift.tt/1lGOXtW



2524 -- Ubiquitous Religions







from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/W82jmk

via LifeLong Community

1611 -- The Suspects Severe acute respiratory syndrome (SARS), an atypical pneumonia of unknown aetiology...

Please Visit: http://ift.tt/1ajReyV



1611 -- The Suspects

Severe acute respiratory syndrome (SARS), an atypical pneumonia of unknown aetiology, was recognized as a global threat in mid-March 2003. To minimize transmission to others, the best strategy is to separate the suspects from others.

In the Not-Spreading-Your-Sickness University (NSYSU), there are many student groups. Students in the same group intercommunicate with each other frequently, and a student may join several groups. To prevent the possible transmissions of SARS, the NSYSU collects the member lists of all student groups, and makes the following rule in their standard operation procedure (SOP).

Once a member in a group is a suspect, all members in the group are suspects.

However, they find that it is not easy to identify all the suspects when a student is recognized as a suspect. Your job is to write a program which finds all the suspects.

http://ift.tt/1gK9poI

http://ift.tt/W82fmO



1611 -- The Suspects







from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/W82fD2

via LifeLong Community

2010 -- Moo University - Financial Aid Bessie noted that although humans have many universities they...

Please Visit: http://ift.tt/1ajReyV



2010 -- Moo University - Financial Aid

Bessie noted that although humans have many universities they can attend, cows have none. To remedy this problem, she and her fellow cows formed a new university called The University of Wisconsin-Farmside,"Moo U" for short.

Not wishing to admit dumber-than-average cows, the founders created an incredibly precise admission exam called the Cow Scholastic Aptitude Test (CSAT) that yields scores in the range 1..2,000,000,000.

Moo U is very expensive to attend; not all calves can afford it.In fact, most calves need some sort of financial aid (0 <= aid <=100,000). The government does not provide scholarships to calves,so all the money must come from the university's limited fund (whose total money is F, 0 <= F <= 2,000,000,000).

Worse still, Moo U only has classrooms for an odd number N (1 <= N <= 19,999) of the C (N <= C <= 100,000) calves who have applied.Bessie wants to admit exactly N calves in order to maximize educational opportunity. She still wants the median CSAT score of the admitted calves to be as high as possible.

Recall that the median of a set of integers whose size is odd is the middle value when they are sorted. For example, the median of the set {3, 8, 9, 7, 5} is 7, as there are exactly two values above 7 and exactly two values below it.

Given the score and required financial aid for each calf that applies, the total number of calves to accept, and the total amount of money Bessie has for financial aid, determine the maximum median score Bessie can obtain by carefully admitting an optimal set of calves.

http://ift.tt/1rgSOxH

http://ift.tt/1A2ombx



2010 -- Moo University - Financial Aid







from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/1rgSOxQ

via LifeLong Community

3614 -- Sunscreen To avoid unsightly burns while tanning, each of the C (1 ≤ C ≤ 2500) cows must cover...

Please Visit: http://ift.tt/1ajReyV



3614 -- Sunscreen



To avoid unsightly burns while tanning, each of the C (1 ≤ C ≤ 2500) cows must cover her hide with sunscreen when they're at the beach. Cow i has a minimum and maximum SPF rating (1 ≤ minSPFi ≤ 1,000; minSPFi ≤ maxSPFi ≤ 1,000) that will work. If the SPF rating is too low, the cow suffers sunburn; if the SPF rating is too high, the cow doesn't tan at all........

The cows have a picnic basket with L (1 ≤ L ≤ 2500) bottles of sunscreen lotion, each bottle i with an SPF rating SPFi (1 ≤ SPFi ≤ 1,000). Lotion bottle i can cover coveri cows with lotion. A cow may lotion from only one bottle.

What is the maximum number of cows that can protect themselves while tanning given the available lotions?

http://ift.tt/SaEgCm

http://ift.tt/1rgSM8Y



3614 -- Sunscreen







from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/1A2olED

via LifeLong Community

3046 -- Ant Counting Bessie was poking around the ant hill one day watching the ants march to and fro...

Please Visit: http://ift.tt/1ajReyV



3046 -- Ant Counting

Bessie was poking around the ant hill one day watching the ants march to and fro while gathering food. She realized that many of the ants were siblings, indistinguishable from one another. She also realized the sometimes only one ant would go for food, sometimes a few, and sometimes all of them. This made for a large number of different sets of ants!

Being a bit mathematical, Bessie started wondering. Bessie noted that the hive has T (1 <= T <= 1,000) families of ants which she labeled 1..T (A ants altogether). Each family had some number Ni (1 <= Ni <= 100) of ants.

How many groups of sizes S, S+1, ..., B (1 <= S <= B <= A) can be formed?

While observing one group, the set of three ant families was seen as {1, 1, 2, 2, 3}, though rarely in that order. The possible sets of marching ants were:

3 sets with 1 ant: {1} {2} {3}

5 sets with 2 ants: {1,1} {1,2} {1,3} {2,2} {2,3}

5 sets with 3 ants: {1,1,2} {1,1,3} {1,2,2} {1,2,3} {2,2,3}

3 sets with 4 ants: {1,2,2,3} {1,1,2,2} {1,1,2,3}

1 set with 5 ants: {1,1,2,2,3}

Your job is to count the number of possible sets of ants given the data above.

http://ift.tt/1A2ojfL

http://ift.tt/1rgSO0x



3046 -- Ant Counting







from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/1A2ojfP

via LifeLong Community

背包问题九讲 http://ift.tt/1jgcjTl

Please Visit: http://ift.tt/1ajReyV



背包问题九讲

http://ift.tt/1jgcjTl



背包问题九讲







from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/1x73Wlt

via LifeLong Community

1742 -- Coins People in Silverland use coins.They have coins of value A1,A2,A3...An Silverland dollar.One...

Please Visit: http://ift.tt/1ajReyV



1742 -- Coins

People in Silverland use coins.They have coins of value A1,A2,A3...An Silverland dollar.One day Tony opened his money-box and found there were some coins.He decided to buy a very nice watch in a nearby shop. He wanted to pay the exact price(without change) and he known the price would not more than m.But he didn't know the exact price of the watch.

You are to write a program which reads n,m,A1,A2,A3...An and C1,C2,C3...Cn corresponding to the number of Tony's coins of value A1,A2,A3...An then calculate how many prices(form 1 to m) Tony can pay use these coins.

http://ift.tt/1uh77m7

http://ift.tt/1x73UKk



1742 -- Coins







from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/1uh77mb

via LifeLong Community

3280 -- Cheapest Palindrome Keeping track of all the cows can be a tricky task so Farmer John has installed...

Please Visit: http://ift.tt/1ajReyV



3280 -- Cheapest Palindrome



Keeping track of all the cows can be a tricky task so Farmer John has installed a system to automate it. He has installed on each cow an electronic ID tag that the system will read as the cows pass by a scanner. Each ID tag's contents are currently a single string with length M (1 ≤ M ≤ 2,000) characters drawn from an alphabet of N (1 ≤ N ≤ 26) different symbols (namely, the lower-case roman alphabet).

Cows, being the mischievous creatures they are, sometimes try to spoof the system by walking backwards. While a cow whose ID is "abcba" would read the same no matter which direction the she walks, a cow with the ID "abcb" can potentially register as two different IDs ("abcb" and "bcba").

FJ would like to change the cows's ID tags so they read the same no matter which direction the cow walks by. For example, "abcb" can be changed by adding "a" at the end to form "abcba" so that the ID is palindromic (reads the same forwards and backwards). Some other ways to change the ID to be palindromic are include adding the three letters "bcb" to the begining to yield the ID "bcbabcb" or removing the letter "a" to yield the ID "bcb". One can add or remove characters at any location in the string yielding a string longer or shorter than the original string.

Unfortunately as the ID tags are electronic, each character insertion or deletion has a cost (0 ≤ cost ≤ 10,000) which varies depending on exactly which character value to be added or deleted. Given the content of a cow's ID tag and the cost of inserting or deleting each of the alphabet's characters, find the minimum cost to change the ID tag so it satisfies FJ's requirements. An empty ID tag is considered to satisfy the requirements of reading the same forward and backward. Only letters with associated costs can be added to a string.

http://ift.tt/1i87Lt0



3280 -- Cheapest Palindrome







from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/1x73UtV

via LifeLong Community

3616 -- Milking Time Bessie is such a hard-working cow. In fact, she is so focused on maximizing her...

Please Visit: http://ift.tt/1ajReyV



3616 -- Milking Time



Bessie is such a hard-working cow. In fact, she is so focused on maximizing her productivity that she decides to schedule her next N (1 ≤ N ≤ 1,000,000) hours (conveniently labeled 0..N-1) so that she produces as much milk as possible.

Farmer John has a list of M (1 ≤ M ≤ 1,000) possibly overlapping intervals in which he is available for milking. Each interval i has a starting hour (0 ≤ starting_houri ≤ N), an ending hour (starting_houri < ending_houri ≤ N), and a corresponding efficiency (1 ≤ efficiencyi ≤ 1,000,000) which indicates how many gallons of milk that he can get out of Bessie in that interval. Farmer John starts and stops milking at the beginning of the starting hour and ending hour, respectively. When being milked, Bessie must be milked through an entire interval.

Even Bessie has her limitations, though. After being milked during any interval, she must rest R (1 ≤ R ≤ N) hours before she can start milking again. Given Farmer Johns list of intervals, determine the maximum amount of milk that Bessie can produce in the N hours.

http://ift.tt/1g4eSmy

http://ift.tt/1qXSuQC



3616 -- Milking Time







from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/1qlPz88

via LifeLong Community

2385 -- Apple Catching It is a little known fact that cows love apples. Farmer John has two apple trees...

Please Visit: http://ift.tt/1ajReyV



2385 -- Apple Catching

It is a little known fact that cows love apples. Farmer John has two apple trees (which are conveniently numbered 1 and 2) in his field, each full of apples. Bessie cannot reach the apples when they are on the tree, so she must wait for them to fall. However, she must catch them in the air since the apples bruise when they hit the ground (and no one wants to eat bruised apples). Bessie is a quick eater, so an apple she does catch is eaten in just a few seconds.

Each minute, one of the two apple trees drops an apple. Bessie, having much practice, can catch an apple if she is standing under a tree from which one falls. While Bessie can walk between the two trees quickly (in much less than a minute), she can stand under only one tree at any time. Moreover, cows do not get a lot of exercise, so she is not willing to walk back and forth between the trees endlessly (and thus misses some apples).

Apples fall (one each minute) for T (1 <= T <= 1,000) minutes. Bessie is willing to walk back and forth at most W (1 <= W <= 30) times. Given which tree will drop an apple each minute, determine the maximum number of apples which Bessie can catch. Bessie starts at tree 1.

http://ift.tt/PLkYl4

http://ift.tt/1qXSsbp



2385 -- Apple Catching







from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/1qlPBwB

via LifeLong Community

2229 -- Sumsets DescriptionFarmer John commanded his cows to search for different sets of numbers that...

Please Visit: http://ift.tt/1ajReyV



2229 -- Sumsets



DescriptionFarmer John commanded his cows to search for different sets of numbers that sum to a given number. The cows use only numbers that are an integer power of 2. Here are the possible sets of numbers that sum to 7:

1) 1+1+1+1+1+1+1

2) 1+1+1+1+1+2

3) 1+1+1+2+2

4) 1+1+1+4

5) 1+2+2+2

6) 1+2+4

Help FJ count all possible representations for a given integer N (1 <= N <= 1,000,000).

http://ift.tt/1lqV7tX

http://ift.tt/1qlPyRw



2229 -- Sumsets







from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/1qXSrV1

via LifeLong Community

3262 -- Protecting the Flowers Farmer John went to cut some wood and left N (2 ≤ N ≤ 100,000) cows ...

Please Visit: http://ift.tt/1ajReyV



3262 -- Protecting the Flowers



Farmer John went to cut some wood and left N (2 ≤ N ≤ 100,000) cows eating the grass, as usual. When he returned, he found to his horror that the cluster of cows was in his garden eating his beautiful flowers. Wanting to minimize the subsequent damage, FJ decided to take immediate action and transport each cow back to its own barn.

Each cow i is at a location that is Ti minutes (1 ≤ Ti ≤ 2,000,000) away from its own barn. Furthermore, while waiting for transport, she destroys Di (1 ≤ Di ≤ 100) flowers per minute. No matter how hard he tries, FJ can only transport one cow at a time back to her barn. Moving cow i to its barn requires 2 × Ti minutes (Ti to get there and Ti to return). FJ starts at the flower patch, transports the cow to its barn, and then walks back to the flowers, taking no extra time to get to the next cow that needs transport.

Write a program to determine the order in which FJ should pick up the cows so that the total number of flowers destroyed is minimized.

http://ift.tt/1rKwteo

http://ift.tt/1nRKcc0



3262 -- Protecting the Flowers







from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/1rKwqPK

via LifeLong Community

1862 -- Stripies Our chemical biologists have invented a new very useful form of life called stripies...

Please Visit: http://ift.tt/1ajReyV



1862 -- Stripies

Our chemical biologists have invented a new very useful form of life called stripies (in fact, they were first called in Russian - polosatiki, but the scientists had to invent an English name to apply for an international patent). The stripies are transparent amorphous amebiform creatures that live in flat colonies in a jelly-like nutrient medium. Most of the time the stripies are moving. When two of them collide a new stripie appears instead of them. Long observations made by our scientists enabled them to establish that the weight of the new stripie isn't equal to the sum of weights of two disappeared stripies that collided; nevertheless, they soon learned that when two stripies of weights m1 and m2 collide the weight of resulting stripie equals to 2*sqrt(m1*m2). Our chemical biologists are very anxious to know to what limits can decrease the total weight of a given colony of stripies.

You are to write a program that will help them to answer this question. You may assume that 3 or more stipies never collide together.

http://ift.tt/1nRK9wY

http://ift.tt/1rKwteg



1862 -- Stripies







from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/1nRKbVt

via LifeLong Community

3040 -- Allowance As a reward for record milk production, Farmer John has decided to start paying Bessie...

Please Visit: http://ift.tt/1ajReyV



3040 -- Allowance

As a reward for record milk production, Farmer John has decided to start paying Bessie the cow a small weekly allowance. FJ has a set of coins in N (1 <= N <= 20) different denominations, where each denomination of coin evenly divides the next-larger denomination (e.g., 1 cent coins, 5 cent coins, 10 cent coins, and 50 cent coins).Using the given set of coins, he would like to pay Bessie at least some given amount of money C (1 <= C <= 100,000,000) every week.Please help him ompute the maximum number of weeks he can pay Bessie.

Input* Line 1: Two space-separated integers: N and C

* Lines 2..N+1: Each line corresponds to a denomination of coin and contains two integers: the value V (1 <= V <= 100,000,000) of the denomination, and the number of coins B (1 <= B <= 1,000,000) of this denomation in Farmer John's possession.

http://ift.tt/1nszt7T

http://ift.tt/Y80nw6



3040 -- Allowance







from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/1nszt7V

via LifeLong Community

1017 -- Packets A factory produces products packed in square packets of the same height h and of the...

Please Visit: http://ift.tt/1ajReyV



1017 -- Packets

A factory produces products packed in square packets of the same height h and of the sizes 1*1, 2*2, 3*3, 4*4, 5*5, 6*6. These products are always delivered to customers in the square parcels of the same height h as the products have and of the size 6*6. Because of the expenses it is the interest of the factory as well as of the customer to minimize the number of parcels necessary to deliver the ordered products from the factory to the customer. A good program solving the problem of finding the minimal number of parcels necessary to deliver the given products according to an order would save a lot of money. You are asked to make such a program.

http://ift.tt/Y80nfE

http://ift.tt/1nszsB4



1017 -- Packets







from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/Y80pnM

via LifeLong Community

2393 -- Yogurt factory The cows have purchased a yogurt factory that makes world-famous Yucky Yogurt...

Please Visit: http://ift.tt/1ajReyV



2393 -- Yogurt factory

The cows have purchased a yogurt factory that makes world-famous Yucky Yogurt. Over the next N (1 <= N <= 10,000) weeks, the price of milk and labor will fluctuate weekly such that it will cost the company C_i (1 <= C_i <= 5,000) cents to produce one unit of yogurt in week i. Yucky's factory, being well-designed, can produce arbitrarily many units of yogurt each week.

Yucky Yogurt owns a warehouse that can store unused yogurt at a constant fee of S (1 <= S <= 100) cents per unit of yogurt per week. Fortuitously, yogurt does not spoil. Yucky Yogurt's warehouse is enormous, so it can hold arbitrarily many units of yogurt.

Yucky wants to find a way to make weekly deliveries of Y_i (0 <= Y_i <= 10,000) units of yogurt to its clientele (Y_i is the delivery quantity in week i). Help Yucky minimize its costs over the entire N-week period. Yogurt produced in week i, as well as any yogurt already in storage, can be used to meet Yucky's demand for that week.

Input* Line 1: Two space-separated integers, N and S.

* Lines 2..N+1: Line i+1 contains two space-separated integers: C_i and Y_i.

http://ift.tt/1toWQqa

http://ift.tt/W4dLzn



2393 -- Yogurt factory







from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/1toWQqc

via LifeLong Community

1328 -- Radar Installation Assume the coasting is an infinite straight line. Land is in one side of ...

Please Visit: http://ift.tt/1ajReyV



1328 -- Radar Installation

Assume the coasting is an infinite straight line. Land is in one side of coasting, sea in the other. Each small island is a point locating in the sea side. And any radar installation, locating on the coasting, can only cover d distance, so an island in the sea can be covered by a radius installation, if the distance between them is at most d.

We use Cartesian coordinate system, defining the coasting is the x-axis. The sea side is above x-axis, and the land side below. Given the position of each island in the sea, and given the distance of the coverage of the radar installation, your task is to write a program to find the minimal number of radar installations to cover all the islands. Note that the position of an island is represented by its x-y coordinates.

http://ift.tt/X1tmB0

http://ift.tt/1u9mPQn



1328 -- Radar Installation







from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/1u9mSLN

via LifeLong Community

3050 -- Hopscotch The cows play the child's game of hopscotch in a non-traditional way. Instead of a...

Please Visit: http://ift.tt/1ajReyV



3050 -- Hopscotch

The cows play the child's game of hopscotch in a non-traditional way. Instead of a linear set of numbered boxes into which to hop, the cows create a 5x5 rectilinear grid of digits parallel to the x and y axes.

They then adroitly hop onto any digit in the grid and hop forward, backward, right, or left (never diagonally) to another digit in the grid. They hop again (same rules) to a digit (potentially a digit already visited).

With a total of five intra-grid hops, their hops create a six-digit integer (which might have leading zeroes like 000201).

Determine the count of the number of distinct integers that can be created in this manner.

http://ift.tt/1jVaWaj

http://ift.tt/W1qLGs



3050 -- Hopscotch







from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/1vDHmPQ

via LifeLong Community

3187 -- Backward Digit Sums FJ and his cows enjoy playing a mental game. They write down the numbers...

Please Visit: http://ift.tt/1ajReyV



3187 -- Backward Digit Sums

FJ and his cows enjoy playing a mental game. They write down the numbers from 1 to N (1 <= N <= 10) in a certain order and then sum adjacent numbers to produce a new list with one fewer number. They repeat this until only a single number is left. For example, one instance of the game (when N=4) might go like this:

3 1 2 4

4 3 6

7 9

16Behind FJ's back, the cows have started playing a more difficult game, in which they try to determine the starting sequence from only the final total and the number N. Unfortunately, the game is a bit above FJ's mental arithmetic capabilities.

Write a program to help FJ play the game and keep up with the cows.

http://ift.tt/1pvftr9

http://ift.tt/1qvl8uP



3187 -- Backward Digit Sums







from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/1qvl66r

via LifeLong Community

2718 -- Smallest Difference Given a number of distinct decimal digits, you can form one integer by choosing...

Please Visit: http://ift.tt/1ajReyV



2718 -- Smallest Difference

Given a number of distinct decimal digits, you can form one integer by choosing a non-empty subset of these digits and writing them in some order. The remaining digits can be written down in some order to form a second integer. Unless the resulting integer is 0, the integer may not start with the digit 0.

For example, if you are given the digits 0, 1, 2, 4, 6 and 7, you can write the pair of integers 10 and 2467. Of course, there are many ways to form such pairs of integers: 210 and 764, 204 and 176, etc. The absolute value of the difference between the integers in the last pair is 28, and it turns out that no other pair formed by the rules above can achieve a smaller difference.

http://ift.tt/1rkcLQL

http://ift.tt/1qvl8uP



2718 -- Smallest Difference







from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/1tnGbTH

via LifeLong Community

3669 -- Meteor Shower Bessie hears that an extraordinary meteor shower is coming; reports say that ...

Please Visit: http://ift.tt/1ajReyV



3669 -- Meteor Shower



Bessie hears that an extraordinary meteor shower is coming; reports say that these meteors will crash into earth and destroy anything they hit. Anxious for her safety, she vows to find her way to a safe location (one that is never destroyed by a meteor) . She is currently grazing at the origin in the coordinate plane and wants to move to a new, safer location while avoiding being destroyed by meteors along her way.

The reports say that M meteors (1 ≤ M ≤ 50,000) will strike, with meteor i will striking point (Xi, Yi) (0 ≤ Xi ≤ 300; 0 ≤ Yi ≤ 300) at time Ti (0 ≤ Ti ≤ 1,000). Each meteor destroys the point that it strikes and also the four rectilinearly adjacent lattice points.

Bessie leaves the origin at time 0 and can travel in the first quadrant and parallel to the axes at the rate of one distance unit per second to any of the (often 4) adjacent rectilinear points that are not yet destroyed by a meteor. She cannot be located on a point at any time greater than or equal to the time it is destroyed).

Determine the minimum time it takes Bessie to get to a safe place.

http://ift.tt/1rsKwRN

http://ift.tt/1qvl5PE



3669 -- Meteor Shower







from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/1tnGbmF

via LifeLong Community

Dashboard - Round 1C 2009 - Google Code Jam Problem In A.D. 2100, aliens came to Earth. They wrote ...

Please Visit: http://ift.tt/1ajReyV



Dashboard - Round 1C 2009 - Google Code Jam



Problem

In A.D. 2100, aliens came to Earth. They wrote a message in a cryptic language, and next to it they wrote a series of symbols. We've come to the conclusion that the symbols indicate a number: the number of seconds before war begins!

Unfortunately we have no idea what each symbol means. We've decided that each symbol indicates one digit, but we aren't sure what each digit means or what base the aliens are using. For example, if they wrote "ab2ac999", they could have meant "31536000" in base 10 -- exactly one year -- or they could have meant "12314555" in base 6 -- 398951 seconds, or about four and a half days. We are sure of three things: the number is positive; like us, the aliens will never start a number with a zero; and they aren't using unary (base 1).

Your job is to determine the minimum possible number of seconds before war begins.

http://ift.tt/1q17P6Q

http://ift.tt/1ujbfkH



Dashboard - Round 1C 2009 - Google Code Jam







from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/1q17MrG

via LifeLong Community

Dashboard - APAC Semifinal 2008 - Google Code Jam You have been invited to the popular TV show "Would...

Please Visit: http://ift.tt/1ajReyV



Dashboard - APAC Semifinal 2008 - Google Code Jam



You have been invited to the popular TV show "Would you like to be a millionaire?".

Of course you would!

The rules of the show are simple:

Before the game starts, the host spins a wheel of fortune to

determine P, the probability of winning each bet.

You start out with some money: X dollars.

There are M rounds of betting. In each round, you can bet any

part of your current money, including none of it or all of it. The amount is not limited to whole dollars or whole cents.

If you win the bet, your total amount of money increases by the amount you bet. Otherwise, your amount of money decreases by the amount you bet.

After all the rounds of betting are done, you get to keep your

winnings (this time the amount is rounded down to whole dollars) only if you have accumulated $1000000 or more. Otherwise you get nothing.

Given M, P and X, determine your probability of winning at least $1000000 if you play optimally (i.e. you play so that you maximize your

chances of becoming a millionaire).

Input

The first line of input gives the number of cases, N.

Each of the following N lines has the format "M P X", where:

M is an integer, the number of rounds of betting.

P is a real number, the probability of winning each round.

X is an integer, the starting number of dollars.

http://ift.tt/1ujbf4h

http://ift.tt/1q17OQj



Dashboard - APAC Semifinal 2008 - Google Code Jam







from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/1ujbf4j

via LifeLong Community

Dashboard - Round 1C 2009 - Google Code Jam Problem In a kingdom there are prison cells (numbered 1...

Please Visit: http://ift.tt/1ajReyV



Dashboard - Round 1C 2009 - Google Code Jam



Problem

In a kingdom there are prison cells (numbered 1 to P) built to form a straight line segment. Cells number i and i+1 are adjacent, and prisoners in adjacent cells are called "neighbours." A wall with a window separates adjacent cells, and neighbours can communicate through that window.

All prisoners live in peace until a prisoner is released. When that happens, the released prisoner's neighbours find out, and each communicates this to his other neighbour. That prisoner passes it on to his other neighbour, and so on until they reach a prisoner with no other neighbour (because he is in cell 1, or in cell P, or the other adjacent cell is empty). A prisoner who discovers that another prisoner has been released will angrily break everything in his cell, unless he is bribed with a gold coin. So, after releasing a prisoner in cell A, all prisoners housed on either side of cell A - until cell 1, cell P or an empty cell - need to be bribed.

Assume that each prison cell is initially occupied by exactly one prisoner, and that only one prisoner can be released per day. Given the list of Q prisoners to be released in Q days, find the minimum total number of gold coins needed as bribes if the prisoners may be released in any order.

Note that each bribe only has an effect for one day. If a prisoner who was bribed yesterday hears about another released prisoner today, then he needs to be bribed again.

http://ift.tt/1ujbgVG

http://ift.tt/1lrU40t



Dashboard - Round 1C 2009 - Google Code Jam







from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/1q17OzO

via LifeLong Community

Googol: Google Code Jam 2008 - Minimum Scalar Product You are given two vectors v1=(x1,x2,...,xn) and...

Please Visit: http://ift.tt/1ajReyV



Googol: Google Code Jam 2008 - Minimum Scalar Product

You are given two vectors v1=(x1,x2,...,xn) and v2=(y1,y2,...,yn). The scalar product of these vectors is a single number, calculated as x1y1+x2y2+...+xnyn.

Suppose you are allowed to permute the coordinates of each vector as you wish. Choose two permutations such that the scalar product of your two new vectors is the smallest possible, and output that minimum scalar product.

http://ift.tt/1ni90Km

http://ift.tt/1lrU40t



Googol: Google Code Jam 2008 - Minimum Scalar Product







from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/1lrU40v

via LifeLong Community

Dashboard - Round 2 2009 - Google Code Jam Problem You are given an N x N matrix with 0 and 1 values...

Please Visit: http://ift.tt/1ajReyV



Dashboard - Round 2 2009 - Google Code Jam



Problem

You are given an N x N matrix with 0 and 1 values. You can swap any two adjacent rows of the matrix.

Your goal is to have all the 1 values in the matrix below or on the main diagonal. That is, for each X where 1 ≤ X ≤ N, there must be no 1 values in row X that are to the right of column X.

Return the minimum number of row swaps you need to achieve the goal.

http://ift.tt/1ila6rj

http://ift.tt/1lrU68J



Dashboard - Round 2 2009 - Google Code Jam







from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/1ni8YCa

via LifeLong Community

3250 -- Bad Hair Day Some of Farmer John's N cows (1 ≤ N ≤ 80,000) are having a bad hair day! Since...

Please Visit: http://ift.tt/1ajReyV



3250 -- Bad Hair Day



Some of Farmer John's N cows (1 ≤ N ≤ 80,000) are having a bad hair day! Since each cow is self-conscious about her messy hairstyle, FJ wants to count the number of other cows that can see the top of other cows' heads.

Each cow i has a specified height hi (1 ≤ hi ≤ 1,000,000,000) and is standing in a line of cows all facing east (to the right in our diagrams). Therefore, cow i can see the tops of the heads of cows in front of her (namely cows i+1, i+2, and so on), for as long as these cows are strictly shorter than cow i.

Consider this example:

=

= =

= - = Cows facing right -->

= = =

= - = = =

= = = = = =

1 2 3 4 5 6

Cow#1 can see the hairstyle of cows #2, 3, 4

Cow#2 can see no cow's hairstyle

Cow#3 can see the hairstyle of cow #4

Cow#4 can see no cow's hairstyle

Cow#5 can see the hairstyle of cow 6

Cow#6 can see no cows at all!

Let ci denote the number of cows whose hairstyle is visible from cow i; please compute the sum of c1 through cN.For this example, the desired is answer 3 + 0 + 1 + 0 + 1 + 0 = 5.

http://ift.tt/1pwR7Nd

http://ift.tt/1pwRabU



3250 -- Bad Hair Day







from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/1pwRabW

via LifeLong Community

poj 2796 Feel Good(单调队列) - 记录成长的点点滴滴. . . . . - 博客频道 - CSDN.NET Bill is developing a new mathematical...

Please Visit: http://ift.tt/1ajReyV



poj 2796 Feel Good(单调队列) - 记录成长的点点滴滴. . . . . - 博客频道 - CSDN.NET

Bill is developing a new mathematical theory for human emotions. His recent investigations are dedicated to studying how good or bad days influent people's memories about some period of life.

A new idea Bill has recently developed assigns a non-negative integer value to each day of human life.

Bill calls this value the emotional value of the day. The greater the emotional value is, the better the daywas. Bill suggests that the value of some period of human life is proportional to the sum of the emotional values of the days in the given period, multiplied

by the smallest emotional value of the day in it. This schema reflects that good on average period can be greatly spoiled by one very bad day.

Now Bill is planning to investigate his own life and find the period of his life that had the greatest value. Help him to do so.

http://ift.tt/1auVja9

http://ift.tt/1CfvUf1



poj 2796 Feel Good(单调队列) - 记录成长的点点滴滴. . . . . - 博客频道 - CSDN.NET







from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/1CfvWng

via LifeLong Community

Algorithm Tutorials http://ift.tt/1qRxlr4...

Please Visit: http://ift.tt/1ajReyV



Algorithm Tutorials

http://ift.tt/1qRxlr4



Algorithm Tutorials







from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/1qRxlr5

via LifeLong Community