-
7 votes
-
What happens now that China won't take US recycling: Many waste-management companies are simply burning recyclables or sending them to landfills
15 votes -
The Kimberley Queen who escaped persecution in Indonesia to find sanctuary in Broome
3 votes -
The Troika Laundromat - How international financial institutions helped Russian oligarchs launder billions
6 votes -
Apple’s Hollywood venture marred by ‘intrusive’ execs, including Tim Cook
10 votes -
All Intel chips open to new Spoiler non-Spectre attack: Don't expect a quick fix
23 votes -
Explosive packages found at Heathrow, Waterloo and London City Airport
7 votes -
US Environmental Protection Agency administrator Wheeler: "Is climate change the existential threat? I don’t see it as the existential threat, no"
7 votes -
Trine 4: The Nightmare Prince - Announcement trailer
7 votes -
Programming Challenge - Find path from city A to city B with least traffic controls inbetween.
Previous challenges Hi, it's been very long time from last Programming Challenge, and I'd like to revive the tradition. The point of programming challenge is to create your own solution, and if...
Hi, it's been very long time from last Programming Challenge, and I'd like to revive the tradition.
The point of programming challenge is to create your own solution, and if you're bored, even program it in your favourite programming language. Today's challenge isn't mine. It was created by ČVUT FIKS (year 5, season 2, challenge #4).
You need to transport plans for your quantum computer through Totalitatia. The problem is, that Totalitatia's government would love to have the plans. And they know you're going to transport the computer through the country. You'll receive number
N, which denotes number of cities on the map. Then, you'll getMpaths, each going from one city to another. Each path hasktraffic controls. They're not that much effective, but the less of them you have to pass, the better. Find path from cityAto cityB, so the maximum number of traffic controls between any two cities is minimal. CityAis always the first one (0) and cityBis always the last one (N-1).Input format:
N M A1 B1 K1 A2 B2 K2 ...On the first two lines, you'll get numbers N (number of cities) and M (number of paths). Than, on next
Mlines, you'll get definition of a path. The definition looks like1 2 6, where1is id of first city and2is id of second city (delimited by a space). You can go from city 1 to city 2, or from city 2 to city 1. The third number (6) is number of traffic controls.Output format:
Single number, which denotes maximum number of traffic controls encountered on one path.
Hint: This means, that path that goes via roads with numbers of traffic controls
4 4 4is better than path via roads with numbers of traffic controls1 5 1. First example would have output4, the second one would have output5.Example:
IN:
4 5 0 1 3 0 2 2 1 2 1 1 3 4 2 3 5OUT:
4Solution: The optimal path is either
0 2 1 3or0 1 3.Bonus
- Describe time complexity of your algorithm.
- If multiple optimal paths exist, find the shortest one.
- Does your algorithm work without changing the core logic, if the source city and the target city is not known beforehand (it changes on each input)?
- Do you use special collection to speed up minimum value search?
Hints
13 votes -
My So-Called (Millennial) Entitlement
9 votes -
Long-term measles vaccine study shows no link with autism — again
19 votes -
Tornadoes in the Southeast are getting worse -- and they're often the deadliest
4 votes -
The Oppression of the Supermajority
15 votes -
Mystery as Quadriga crypto-cash goes missing
5 votes -
Game of Thrones | Season 8 official trailer
20 votes -
Google pay study finds it underpaid men for some jobs
13 votes -
New window film reduces energy costs
4 votes -
Why you have that little, lying voice in your head
2 votes -
15 non-obvious HPC experts to follow on Twitter
2 votes -
Game of Thrones first look: Inside the brutal battle to make season 8
7 votes -
D.Tube as a viable YouTube Alternative?
18 votes -
Kipple field notes
3 votes -
test
test
3 votes -
Delete never: The digital hoarders who collect Tumblrs, medieval manuscripts, and terabytes of text files
35 votes -
I stood up to Apple and fixed my own Mac
7 votes -
The Green New Deal Needs WWII-Scale Ambition
13 votes -
Warrior | Official season 1 trailer
5 votes -
HIV is reported cured in a second patient, a milestone in the global AIDS epidemic
17 votes -
The fake sex doctor who conned the media into publicizing his bizarre research on suicide, butt-fisting, and bestiality
14 votes -
Heat your house with a water brake windmill
20 votes -
USB4 will support Thunderbolt and double the speed of USB 3.2
20 votes -
Anthem players say the game is shutting down and even sometimes bricking their PS4s
13 votes -
I have forgotten how to read: For a long time Michael Harris convinced himself that a childhood spent immersed in old-fashioned books would insulate him from our new media climate. He was wrong.
19 votes -
ALOHAnet - The oft-forgotten Precusor to Wireless Communication
4 votes -
The Firefox Experiments I Would Have Liked To Try
10 votes -
I feel it would be convenient to make theme changing faster
If I'm the weirdo in the minority here, feel free to let me know, but I ideally switch between day and night modes almost daily on my websites and apps based on time of day. Here, it's usually...
If I'm the weirdo in the minority here, feel free to let me know, but I ideally switch between day and night modes almost daily on my websites and apps based on time of day. Here, it's usually between the White and Black settings. And while it's not a big problem by any means, navigating between 3 different pages (the homepage, my user page, then settings) is a tiny hassle that I feel could be avoided by placing the theme switching option on the homepage. I don't know if my usage of themes is normal or an abnormality, so I understand if putting it directly on the homepage isn't ideal if most users don't switch themes constantly. It would still be a fair bit faster if it were to be placed on the profile page somewhat similar to Reddit or YouTube (I'm not talking about the overlay, just moving the switcher from settings to maybe part of the User Menu).
I have noticed that most apps with a dark mode tend to bury it in settings, clearly indicating that it's designed to be a one time change, so again, maybe this is just a me problem, but I am curious on how others feel about a more easily on hand theme option.
13 votes -
Pinpoint your location using only three words
30 votes -
Google employees uncover ongoing work on censored China search
9 votes -
All the numbers
7 votes -
What are some anime/manga that are underrated and/or not so popular?
I'm still fairly new to anime (~2.5 years) and have been just watching either classics/high rated anime or whatever everyone else is watching that season and really want to know what are some...
I'm still fairly new to anime (~2.5 years) and have been just watching either classics/high rated anime or whatever everyone else is watching that season and really want to know what are some pretty good anime/manga that are underrated and overshadowed by huge influx of anime every season?
Mine picks would be:
-
One Outs : It's basically a Sports anime about Baseball with heavily focusing on mind games (similar to Death Note/Code Geass/etc) It is 8.4 on MAL but It's really underrated in terms of it's audience
-
Black Clover : It's really not that bad as people say it is. Yes the adaptation is bad but the story is really good, yeah it's basically generic shonen but it does the generic shonen things much better than other generic shonens. I'd still suggest the manga over the anime (with coming back to see the climax of arcs/seeing your favourite scenes being adapted)
For Manga:
-
Gokushufudou (The Way of the House Husband) : It's basically a manga about an ex-most wanted gangster now living as a house husband. It's one of the most funniest mangas I've read.
-
Vigilante: Boku no Hero Academia Illegals : It's a spinoff of My Hero Aca which is pretty cool but not really popular. The story could be boiled down to what would've happened if Midoriya wasn't able to pass the UA exams. Oh yeah and it's all canon (the main author verified this).
That's basically it for what I've read/watched.
15 votes -
-
The next financial crisis could be caused by climate change
15 votes -
Legend of Zelda: Breath of the Wild has been helping with my winter cabin fever!
I live in Minnesota and we have gotten record-setting cold and snow over this last month. I've noticed myself getting depressed and angry about stuff much more than I do usually. Just by...
I live in Minnesota and we have gotten record-setting cold and snow over this last month. I've noticed myself getting depressed and angry about stuff much more than I do usually. Just by coincidence, I started playing Zelda more on my Switch. Somehow, making Link walk around in the nice forests and mountains has affected me outside of the game! I feel less pissed off! Give this technique a try if you're in the same boat I am this winter.
Also, I was about to sell this game because I hated it, now I'm loving it. No prior game has caused me to simultaneously love and hate a game. Weird.
9 votes -
Retrohistories: The first "game over"
3 votes -
There’s new evidence for what happened to people who survived Vesuvius
8 votes -
The making of the Fox News White House
19 votes -
The new ‘dream home’ should be a condo
20 votes -
What it’s like working as an Amazon Flex delivery driver
5 votes -
The ten best horns in the animal world: The definitive list
6 votes -
Troika laundromat: A special investigation into leaked papers showing how vast sums of Russian money were channelled into western banks
10 votes