题解 | #尼科彻斯定理#

尼科彻斯定理

http://www.nowcoder.com/practice/dbace3a5b3c4480e86ee3277f3fe1e85

def myfunc(x):
    result = []
    y = int(pow(x, 3) / x)
    if x % 2 == 0:
        for i in range(x//2):
            temp_1 = y - 1 - 2*i
            result.append(temp_1)
            temp_2 = y + 1 + 2*i
            result.append(temp_2)
    else:
        result.append(y)
        for i in range(x//2):
            temp_1 = y - 2 - 2*i
            result.append(temp_1)
            temp_2 = y + 2 + 2*i
            result.append(temp_2)
    return result

while True:
    try:
        a = int(input())
        b = myfunc(a)
        b.sort()
        print(*b,sep="+")
    except:
        break
全部评论

相关推荐

炫哥_:哥们项目描述里面vector和mysql之类的都要写吗,直接开头技术栈巴拉巴拉就行了,完全不是技术点啊
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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