r/adventofcode • • Dec 06 '18

SOLUTION MEGATHREAD -🎄- 2018 Day 6 Solutions -🎄-

--- Day 6: Chronal Coordinates ---


Post your solution as a comment or, for longer solutions, consider linking to your repo (e.g. GitHub/gists/Pastebin/blag or whatever).

Note: The Solution Megathreads are for solutions only. If you have questions, please post your own thread and make sure to flair it with Help.


Advent of Code: The Party Game!

Click here for rules

Please prefix your card submission with something like [Card] to make scanning the megathread easier. THANK YOU!

Card prompt: Day 6

Transcript:

Rules for raising a programmer: never feed it after midnight, never get it wet, and never give it ___.


This thread will be unlocked when there are a significant number of people on the leaderboard with gold stars for today's puzzle.

edit: Leaderboard capped, thread unlocked at 0:26:52!

32 Upvotes

387 comments sorted by

View all comments

35

u/daveagp Dec 06 '18

I seem to have got my part 2 solution rejected despite getting the same answer as at least one of the solutions posted here. Did anyone else have this happen to them?

12

u/Saluev Dec 06 '18

I hope they log failed attempts and we can get our deserved positions in the leaderboard after all.

11

u/teraflop Dec 06 '18

Same here. /u/topaz2078 mentioned on another thread that there are only a finite number of input files, so maybe one of them is bad and we were all unlucky enough to get it?

My input starts with 181, 184 and my answer for part 2 was 46054, for what it's worth.

4

u/NewHorizons0 Dec 06 '18

Same input and answer for me, indeed.

→ More replies (2)

3

u/qacek Dec 06 '18

Mine with 337, 150

→ More replies (9)

2

u/Saluev Dec 06 '18 edited Dec 06 '18

Mine starts with 165, 169.

2

u/xthexder Dec 06 '18 edited Dec 06 '18

Same issue on 292, 73

→ More replies (1)
→ More replies (5)

8

u/NewHorizons0 Dec 06 '18

Yes, me too. I ran the Python solution from the comments, and find the same result as my solution, but it was rejected.

5

u/Saluev Dec 06 '18

Same here.

5

u/Arknave Dec 06 '18

+1 here as well. Thought I was losing my mind.

2

u/shuttup_meg Dec 06 '18

It could be that OP's input data didn't exercise edge cases that your input data did. In this case it wouldn't be a "bug" per se, but rather an unfortunate reality that not all of our input data sets are equally easy.

4

u/Saluev Dec 06 '18

Well, I (and also /u/NewHorizons0 below) did visualizations to check if there are any extreme corner cases. But everything looks fine. The bounds are wide enough, and the region is a single component (as it should be, being always a convex set by construction).

→ More replies (3)
→ More replies (2)
→ More replies (1)

6

u/Brayzure Dec 06 '18 edited Dec 06 '18

It's happening to me as well.

Edit: Ripped a solution from here, used it, gave me the same answer my solution was giving. Will be a little frustrating if I missed out on leaderboard due to a bug, though I hope it's just my making a silly mistake.

4

u/anttihaapala Dec 06 '18

Same thing.

5

u/itwentboom Dec 06 '18 edited Dec 06 '18

Is this happening for anyone on part 1? A solution posted here yielded the same result for me as my own failing answer so can't figure out what's wrong

EDIT: I had someone who successfully submitted use my input with their algo and verified they got same output. So yeah something's definitely up.

4

u/Voltasalt Dec 06 '18

I'm having the same issue. My input starts with 227, 133 and getting the output 2906. Confirmed with another implementation but the site rejects it.

→ More replies (1)
→ More replies (9)

4

u/winstonewert Dec 06 '18

Yes, my answer is rejected, despite getting the same answer as at least one of the answers posted already.

4

u/Kawigi Dec 06 '18

PLEEEASE tell me it's not me, I've implemented it from scratch 3 times and reread the description several more times :-|

4

u/-Jason- Dec 06 '18 edited Dec 06 '18

Yep, same, this is my numpy solution that's failing:

xvalues = np.arange(coords[:,0].max())
yvalues = np.arange(coords[:,1].max())
xx, yy = np.meshgrid(xvalues, yvalues)

layers = []
for coord in coords:
    mdists = np.abs(xx - coord[0]) + np.abs(yy - coord[1])
    layers.append(mdists)
    
dist_arr = np.array(layers)
tot_dists = dist_arr.sum(axis=0)
(tot_dists < 10000).sum()

(increasing grid bounds yields same result)

→ More replies (2)

3

u/mcpower_ Dec 06 '18

Yep, same here...

3

u/kevinwangg Dec 06 '18

rip. shoulda checked here earlier.

2

u/AvianPoliceForce Dec 06 '18

Yeah, same here.

2

u/Shemetz Dec 06 '18

Yup, it's happening to me too!

2

u/apazzolini Dec 06 '18

Glad I checked here, I was feeling good about my part 2 solution, but answer keeps getting rejected. Verified with some of the other inputs and I get the same answer.

I even built a visualization to figure out if I had some failure in logic

https://d3vv6lp55qjaqc.cloudfront.net/items/2i0C293U352Y0H1P0A45/Image%202018-12-06%20at%2012.04.55%20AM.png

→ More replies (2)
→ More replies (9)