Created
June 15, 2021 07:10
-
-
Save Kernelzero/68926d417d37a47f2bd0ea6b5caf1f47 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
array = list() | |
array.append([1]) | |
def pascal_triangle(): | |
length = len(array) | |
if length != 100: | |
temp_array = [1] | |
for n in range(length-1): | |
temp = array[length-1][n] + array[length-1][n+1] | |
temp_array.append(temp) | |
temp_array.append(1) | |
array.append(temp_array) | |
pascal_triangle() | |
else: | |
return | |
pascal_triangle() | |
# print(array) | |
r_array = list() | |
# print(r_array) | |
def rotate(): | |
temp_array2 = list() | |
for i in range(len(array)): | |
if len(array[i]) > 0: | |
val = array[i].pop() | |
temp_array2.append(val) | |
# elif len(array[i]) == 0: | |
# array.pop(i) | |
r_array.append(temp_array2) | |
if len(r_array) != 100: | |
rotate() | |
rotate() | |
# print(r_array) | |
r, c = map(int, input().split()) | |
result = r_array[r-1][c-1] % 100000000 | |
print(result) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment