Author Archive: Paul Epps

Be Thankful That You’re Miserable

 

I feel that life is divided into the horrible and the miserable. That’s the two categories. The horrible are like, I don’t know, terminal cases, you know, and blind people, crippled. I don’t know how they get through life. It’s amazing to me. And the miserable is everyone else. So you should be thankful that you’re miserable, because that’s very lucky, to be miserable. — Alvy Singer Read more →

Competitive Programming: CodeSignal – footballGroupStatictics (A World Cup SQL Challenge)

 

Description You are creating a website that will help you and your friends keep track of the results of soccer games from all around the world. You store all results of one group in a table, results. You want to sort the teams in a complex way – first by points, then by total goal differences, and then by total goals. If all of these parameters are equal, sort the teams alphabetically. The results table contains the following columns: first_team – the name of the first team; second_team – the name of the second team; first_team_score – the number of goals scored by the first team; second_team_score – the number of goals scored by the second team. Here the primary key is the pair (first_team, second_team). Return the list of team names sorted in the way described above. Note: see three points for a win to understand how points are… Read more →

Competitive Programming: CodeSignal – canScore (A World Cup Challenge)

 

Description Your friend is a soccer fan and you were watching some World Cup matches with him. You liked this game, but the rules are very complicated for you, so you decided just to try to guess whether the given attack will end with a goal or not. In the beginning, the ball is in the attacking team’s goalkeeper’s hands. On the attacking team, there’s a very talented goalscorer, who is waiting for his chance at the other end of the field. His teammates want to give him the ball so he can score. They can move the ball by passing it one to another along a straight line, but the defender can steal the pass if he is closer than d to the ball at any point throughout the pass. Now you want to know if the attacking team can score or not. Formally, you are given the coordinates… Read more →

End of the World Poll

 

Musical question: What is a good song to play when the nukes start falling? We’ll Meet Again What a Wonderful World Eve of Destruction We’ll All Go Together When We Go Always Look on the Bright Side of Life Clair de Lune Something short Read more →

Doesn’t Tell Me What I Need to Know

 

A co-worker is telling another co-worker that you have to make sure day care providers are insured and bonded. Actually, being insured and bonded is no guarantee that I want you taking care of my child . . . “Mr. So-and-so, your son wouldn’t stop crying so we taped his mouth shut. The bad news is: he died. The good news is we’re insured and bonded!” Read more →

Competitive Programming: POJ 3281- Dining

 

Description Cows are such finicky eaters. Each cow has a preference for certain foods and drinks, and she will consume no others. Farmer John has cooked fabulous meals for his cows, but he forgot to check his menu against their preferences. Although he might not be able to stuff everybody, he wants to give a complete meal of both food and drink to as many cows as possible. Farmer John has cooked F (1 <= F <= 100) types of foods and prepared D (1 <= D <= 100) types of drinks. Each of his N (1 <= N <= 100) cows has decided whether she is willing to eat a particular food or drink a particular drink. Farmer John must assign a food type and a drink type to each cow to maximize the number of cows who get both. Each dish or drink can only be consumed by… Read more →

Competitive Programming: POJ 2455 – Secret Milking Machine

 

Description Farmer John is constructing a new milking machine and wishes to keep it secret as long as possible. He has hidden in it deep within his farm and needs to be able to get to the machine without being detected. He must make a total of T (1 <= T <= 200) trips to the machine during its construction. He has a secret tunnel that he uses only for the return trips. The farm comprises N (2 <= N <= 200) landmarks (numbered 1..N) connected by P (1 <= P <= 40,000) bidirectional trails (numbered 1..P) and with a positive length that does not exceed 1,000,000. Multiple trails might join a pair of landmarks. To minimize his chances of detection, FJ knows he cannot use any trail on the farm more than once and that he should try to use the shortest trails. Help FJ get from the barn… Read more →

Decisions Are Not “Right” or “Wrong”

 

Decisions are bets on the future, and they aren’t “right” or “wrong” based on whether they turn out well on any particular iteration. An unwanted result doesn’t make our decision wrong if we thought about the alternatives and probabilities in advance and allocated our resources accordingly. . . . It would be absurd for me, after making a big bet on the best possible starting hand (a pair of aces) and losing, to spend a lot of time thinking I was wrong to make the decision to play the hand in the first place. . . . When we think probabilistically, we are less likely to use adverse results alone as proof that we made a decision error, because we recognize the possibility that the decision might have been good but luck and/or incomplete information (and a sample size of one) intervened. Maybe we made the best decision from a… Read more →

Competitive Programming: POJ 2195 – Going Home

 

Description On a grid map there are n little men and n houses. In each unit time, every little man can move one unit step, either horizontally, or vertically, to an adjacent point. For each little man, you need to pay a $1 travel fee for every step he moves, until he enters a house. The task is complicated with the restriction that each house can accommodate only one little man. Your task is to compute the minimum amount of money you need to pay in order to send these n little men into those n different houses. The input is a map of the scenario, a ‘.’ means an empty space, an ‘H’ represents a house on that point, and am ‘m’ indicates there is a little man on that point. You can think of each point on the grid map as a quite large square, so it can… Read more →

You Think I’m Inept?

 

“You think I’m inept? You think I’m inadequate? If I’m inadequate, where are you going to get people who are adequate . . . if I’m . . . do you understand what I’m saying? What am I supposed to be? What are other people if I am inadequate?” — Philip Roth, American Pastoral Read more →

Sorrow Without Limits

 

The whole order of things fills me with a sense of anguish, from the gnat to the mysteries of incarnation; all is entirely unintelligible to me, and particularly my own person. Great is my sorrow, without limits. None knows of it, except God in Heaven, and He cannot have pity. — Sören Kierkegaard Read more →

It Is Just Too Shaking and Wearing

 

We are just not strong enough to endure more! It is just too shaking and wearing. So often people in . . . ecstatic moments say, “It’s too much,” or “I can’t stand it,” or “I could die” . . . Delirious happiness cannot be borne for long. Our organisms are just too weak for any large doses of greatness. — Abraham Maslow Read more →

Non ridere, non lugere, neque detestari, sed intelligere. (Not to laugh, not to curse, not to lament, but to understand.) — Spinoza

Competitive Programming: POJ 3169 – Layout

 

Description 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… Read more →

Competitive Programming: POJ 1125 – Stockbroker Grapevine

 

Description Stockbrokers are known to overreact to rumors. You have been contracted to develop a method of spreading disinformation amongst the stockbrokers to give your employer the tactical edge in the stock market. For maximum effect, you have to spread the rumors in the fastest possible way. Unfortunately for you, stockbrokers only trust information coming from their “Trusted sources” This means you have to take into account the structure of their contacts when starting a rumor. It takes a certain amount of time for a specific stockbroker to pass the rumor on to each of his colleagues. Your task will be to write a program that tells you which stockbroker to choose as your starting point for the rumor, as well as the time it will take for the rumor to spread throughout the stockbroker community. This duration is measured as the time needed for the last person to receive… Read more →

USC’s Unreal Finish to Win Track and Field Championship

 

I’ve never seen a come-from-behind finish like this! The male announcer says twice in the home stretch that Purdue is going to win the race. Female announcer: “Here comes USC.” Male announcer: “Not gonna catch Purdue . . . oh my god . . .” The @usc_track_field Women of Troy had to win the 4x400m to win the national championship. WATCH WHAT #FIGHTON LOOKS LIKE! pic.twitter.com/BOrISxUXXq — USC Trojans (@USC_Athletics) June 10, 2018 Read more →

« Previous PageNext Page »