Last active
October 6, 2017 20:03
-
-
Save eupp/f6e3ddcce80a633ee412beba1230deed 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
def fuck(n): | |
A = [0] * (n+1) | |
B = [-1] * (n+1) | |
for i in range(2, n+1): | |
A[i] = A[i - 1] | |
B[i] = i-1 | |
if i % 2 == 0 and A[int(i / 2)] < A[i]: | |
A[i] = A[int(i / 2)] | |
B[i] = int(i / 2) | |
if i % 3 == 0 and A[int(i / 3)] < A[i]: | |
A[i] = A[int(i / 3)] | |
B[i] = int(i / 3) | |
A[i] += 1 | |
print(A[1:]) | |
print(B[1:]) | |
fuck(5) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment