We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.

# Project Euler #186: Connectedness of a network.

# Project Euler #186: Connectedness of a network.

#### Sort by

recency

#### |

#### 11 Discussions

#### |

Please Login in order to post a comment

I am considering initial use-case: 000000 1 Before the PM number is met for the second time (call number 622573) almost all the previous calls have been made between "independent" users. In other words, all of them are parts of groups within size 2. So, there is no one big group of frends which include 10000 users/friends of PM. SO, It looks like there is an issue. OR I've not got something. Here is my code:

`

I have a solution in python3 that I think is using correct data structure and is quite optimized. However, test case 20 is always timing out nad test case 19 is saying wrong answer. Is there anyone with similar issues?

how

hey, I need help.

I am more or less done, but I am stuck with 1 strange bug.

I am counting how many numbers I have generated until the prime minister has enough "friends". If I divide that number by 2, I get the number of calls. My solution is 622573 calls (622572 would be right) for the test case.

Thats why I subtract 1 from my "solution", but that way I only get 60 points (12/20 testcases correct). If I subtract 2 from my "solution", I get 35 points (7/20 testcases correct). As for testcase 20/20, I never got that one right.

What could be my bug/misunderstanding of the problem??

Edit: fixed it now. 100/100points. forgot to count the misdials ^^'

Can anyone who has finished this problem explain how they avoided overflowing their numbers when calculating for large k. I'm stuck on this.