Skip to content

Section Archive

Archive

N/A

Entries 16
Categories 23
Tags 190

12 entries on this page

UVa Online Judge Challenge "1112"

This problem involves a relatively small graph, so I opted to implement the Floyd-Warshall Algorithm instead of Dijkstra’s Algorithm for the sake of simplicity. This algorithm finds the shortest path between every pair of vertices in a graph, running in O(n^3) time. Although this might sound inefficient, the UVA judge accepted this program with a runtime of 0.12 seconds, which is well within the 3-second threshold. I designed this algorithm using an object-oriented approach and avoided arrays, so that if I ever have enough free time, I can easily integrate it into Processing and visualize it in 3D.

UVa Online Judge Challenge "1112"

UVa Online Judge Challenge "10110"

“There is man named ”mabu” for switching on-off light in our University. He switches on-off the lights in a corridor. Every bulb has its own toggle switch. That is, if it is pressed then the bulb turns on. Another press will turn it off. To save power consumption (or may be he is mad or something else) he does a peculiar thing. If in a corridor there is n bulbs, he walks along the corridor back and forth n times and in i-th walk he toggles only the switches whose serial is divisable by i. He does not press any switch when coming back to his initial position. A i-th walk is defined as going down the corridor (while doing the peculiar thing) and coming back again. Now you have to determine what is the final condition of the last bulb. Is it on or off?”

UVa Online Judge Challenge "10110"

Kattis Challenge "Parking"

“When shopping on Long Street, Michael usually parks his car at some random location, and then walks to the stores he needs. Can you help Michael choose a place to park which minimises the distance he needs to walk on his shopping round? Long Street is a straight line, where all positions are integer. You pay for parking in a specific slot, which is an integer position on Long Street. Michael does not want to pay for more than one parking though. He is very strong, and does not mind carrying all the bags around.”

Kattis Challenge "Parking"

More to Browse

Adjacent collections

  1. Posts109
  2. Prompts2
  3. Archive16
  4. Categories23
  5. Tags190

Relationship Map

Memory Field

Use the relationship map to follow related categories, tags, and entries beyond the current list.

Categories 0
Tags 0
Entries 0