题解 | #杨辉三角的变形# 找规律,好难
杨辉三角的变形
https://www.nowcoder.com/practice/8ef655edf42d4e08b44be4d777edbf43
# 行数-结果
# 1-0
# 2-0
# 3-2 3%4=3
# 4-3 4%4=0
# 5-2 5%4=1
# 6-4 6%4=2
# 7-2 7%4=3
# 8-3 8%4=0
n = int(input())
if n <= 2:
result = -1
else:
if n % 4 == 0:
result = 3
if n % 4 == 1 or n % 4 == 3:
result = 2
if n % 4 == 2:
result = 4
print(result)
字节跳动公司福利 1309人发布
