题解 | #尼科彻斯定理#

尼科彻斯定理

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

m = int(input())
m_cube = m ** 3

odd = []
if m % 2 == 1:
    first = int(m ** 2 - (m // 2) * 2)
else:
    first = int(m ** 2 - (m // 2) * 2 + 1)
odd.append(first)
for i in range(2, m * 2, 2):
    num = first + i
    odd.append(num)

out = '+'.join(str(i) for i in odd)
print(out)

全部评论

相关推荐

有气魄的马来熊在摸鱼:我爱vivo 马上换手机 vivo我爱你!!!
点赞 评论 收藏
分享
10-29 18:20
济南大学 Java
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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