This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def maxsubarr(arr): | |
| h=len(arr) | |
| w=len(arr[0]) | |
| bestsum=arr[0][0] | |
| bestcoords=None | |
| for lbeg in range(h): | |
| for cbeg in range(w): | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Trie: | |
| def __init__(self): | |
| self.children={} | |
| self.label=None | |
| def findall(self): | |
| matches=set() | |
| if self.label!=None: | |
| matches.add(self.label) | |
| for child in self.children: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Port-Vendres | |
| Roscoff | |
| Toulouse-Matabiau | |
| Sarreguemines | |
| Lyon-Part-Dieu | |
| Romorantin-Blanc-Argent | |
| Veynes-Dévoluy | |
| Calais Ville | |
| Lannion | |
| Hazebrouck |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Strasbourg | |
| Lille Flandres | |
| Lyon-Part-Dieu | |
| Nancy-Ville | |
| Marseille-St-Charles | |
| Bordeaux-St-Jean | |
| Toulouse-Matabiau | |
| Nantes | |
| Rennes | |
| Lyon-Perrache |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Strasbourg | |
| Lille Flandres | |
| Lyon-Perrache | |
| Marseille-St-Charles | |
| Metz-Ville | |
| Bordeaux-St-Jean | |
| Toulouse-Matabiau | |
| Avignon-Centre | |
| Nantes | |
| Mulhouse |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| MiT | |
| Smoked Chicken | |
| Leet More | |
| Hates Irony | |
| sutegoma2 | |
| lollersk8ers | |
| European Nopsled Team | |
| Routards | |
| Plaid Parliament of Pwning | |
| Shellphish |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| participants = '''@Greglimo1 | |
| @maxencedevigne | |
| @z3gh0st | |
| @4quatre4quatre | |
| @YavuzSonmez_ | |
| @Tek_7987 | |
| @Maskott6 | |
| @corsicajack | |
| @SmxPlayer | |
| @le_jop |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import requests | |
| from aoc_secrets import AOC_COOKIE | |
| YEAR = '2016' | |
| def get_input(day): | |
| req = requests.get(f'https://adventofcode.com/{YEAR}/day/{day}/input', headers={'cookie':'session='+AOC_COOKIE}) | |
| return req.text | |
| def get_example(day,offset=0): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ''' | |
| Advent of Code automation template - @MathisHammel | |
| This template provides functions to download inputs and submit answers on AoC. | |
| You need to paste your adventofcode.com session cookie below. | |
| If you don't know how to get this cookie, here's a quick tutorial: | |
| - Open your browser and go to adventofcode.com, make sure you are logged in | |
| - Open the developer console (Ctrl+Shift+I on Firefox/Chrome) | |
| - Get the value of your session cookie: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| participants = '''@the_duf_ | |
| @driikolu | |
| @Tashiqi | |
| @PontyGuillaume | |
| @MrAdrien79 | |
| @Nicoverflow | |
| @dourojp | |
| @Durab_ | |
| @Femtozer | |
| @C_Papazian |
OlderNewer