r/adventofcode • u/daggerdragon • Dec 16 '16
SOLUTION MEGATHREAD --- 2016 Day 16 Solutions ---
--- Day 16: Dragon Checksum ---
Post your solution as a comment or, for longer solutions, consider linking to your repo (e.g. GitHub/gists/Pastebin/blag/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".
DRINKING YOUR OVALTINE IS MANDATORY [?]
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!
5
Upvotes
View all comments
Show parent comment
1
u/JakDrako Dec 16 '16
Hmm. Maybe I'm timing it wrong? I had a bit of trouble getting a timing for the run, since Windows doesn't have a "time" command like Unix... I had "timeit.exe" from an old Windows Resource Kit but it doesn't work on Windows 10.
So I'm using the PowerShell "Measure-Command" thing-a-ma-gig. I modified your code to include the key and length inline. When I run it, the console flashes instantly (PowerShell starts a new console to run in...) and I get:
I tested a version with a "std::cin >> foo" at the end to make sure the result was there, and it was... plus, my C# solution runs in 120ms, and that's managed code with the CLR overhead, so C++ should do better. How aggressive is the Macbook in throttling the CPU when on battery?