-
-
Save lyxal/da38558c80d395ddc1273cbe13a46a6f to your computer and use it in GitHub Desktop.
This file contains 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
from itertools import * | |
from string import * | |
from math import * | |
i = open("input.txt").read().split("\n") | |
row_up = 128 | |
row_low = 1 | |
col_up = 8 | |
col_low = 1 | |
ids = [] | |
for l in i: | |
for c in l: | |
if c == "F": | |
row_up /= 2 | |
if c == "B": | |
row_low *= 2 | |
if c == "L": | |
col_low *= 2 | |
if c == "R": | |
col_up /= 2 | |
ids.append(((row_up+row_down)/2)*8 + (col_up + col_down)/2) | |
print(max(ids)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment