题解 | #杨辉三角的变形#

杨辉三角的变形

https://www.nowcoder.com/practice/8ef655edf42d4e08b44be4d777edbf43

num = int(input().strip())
import sys
a = num
a1 = [2, 3, 2, 4]
if a <= 2:
    print("-1")
    sys.exit()
else:
    re1 = (a-2)%4
    if re1 == 0:
        print('4')
    else:
        print(a1[re1-1])

全部评论

相关推荐

06-19 13:40
武汉大学 Java
点赞 评论 收藏
分享
asdasdasdasdas:19岁,不容易啊可能升个本会好点,现在学历歧视太严重了
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务