/aocg/ - Advent of Code 2018 General #16

Pythonlet's anguish edition

Previous thread: adventofcode.com/
>Advent of Code is a series of small programming puzzles for a variety of skill levels. They are self-contained and are just as appropriate for an expert who wants to stay sharp as they are for a beginner who is just learning to code. Each puzzle calls upon different skills and has two parts that build on a theme.
You need to register with an account but you can appear as anonymous.

Private leaderboard join code (currently full):

368748-e33dcae3

People who are inactive for 5 days will be kicked, but other leaderboards can be made if desired.

Alternative leaderboard for those waiting for inactives to be kicked from the first:

208834-4a1a9383

Attached: dexter-deedee-mixing-chemicals.png (620x500, 283K)

Other urls found in this thread:

pastebin.com/jBLi93fV
ptpb.pw/fzAN.js/js.
ptpb.pw/YRa_.json/json.
anonfile.com/K0n2Lbm3bf/biginput
anonfile.com/edr0L0mab2/biginput
maurits.vdschee.nl/scatterplot/
firecracker-microvm.github.io/
mega.nz/#!Cz5h1QDT!YKzqfnY2fRN--s4ZbaFzj3_HO3uHhmbo02Rw-TbUe20
twitter.com/NSFWRedditGif

first for C++ best language

Ha. here. You guys probably thought I'd given up. Day 3 part 1 with a quadtree. Picrel is time on Big Boy from , finally verifying 's result.

Attached: bigboytime.png (166x91, 11K)

somebody better be making a goddamn big boy input

Attached: 4u.jpg (200x266, 18K)

how the fuck are you guys getting such quick runtimes?

my input requires like 740 recursive calls to be fully reacted, so my time is fucking garbage

Attached: 1501926931413.jpg (442x276, 33K)

pastebin.com/jBLi93fV

def obfuscate(data,num):
from random import randint, choice
from string import ascii_lowercase as lo, ascii_uppercase as up
ins = [a+b for a,b in list(zip(up,lo)) + list(zip(lo,up))]
for _ in range(num):
n = randint(0,len(data))
rep = choice(ins)
data = data[:n] + rep + data[n:]
return data

import string

def polylen(line):
while 1:
oldLen = len(line)
for c in string.ascii_lowercase:
line = line.replace(c + c.upper(), "")
line = line.replace(c.upper() + c, "")
if len(line) == oldLen:
return len(line)


x = open("input").read().strip()
best_d = float('inf')
for c in string.ascii_lowercase:
d = polylen(x.replace(c, "").replace(c.upper(), ""))
if d < best_d:
best_d = d

print("star1: %s" % polylen(x))
print("star2: %s " % best_d)

This python is kinda fast +- 5sec total time for both stars at once

Just run this with num equaling some big boy number.

Here's the source for anyone interested: ptpb.pw/fzAN.js/js.
Plus a package.json for convenience: ptpb.pw/YRa_.json/json.

Reference solution coming through?

Attached: aoc18d5.png (754x871, 37K)