题目描述 俄罗斯套娃是俄罗斯特产的木制玩具,一般由多个一样图案的空心木娃娃一个套一个组成,最多可达十多个,通常为圆柱形,底部平坦可以直立.颜色有红色,蓝色,绿色,紫色等.最普通的图案是一个穿着俄罗斯民族服装的姑娘,叫做“玛特罗什卡”,这也成为这种娃娃的通称. 彩虹岛也有自己的套娃,不过与俄罗斯套娃有所不同,其组成规则如下:1. 空心木娃娃只有正方体与球两种形状.2. 正方体娃娃与球体娃娃可以相互套,也可以相同形状之间套.3. 当两形状相切的时候使能够互相嵌套的,比如半径为2的球体能套在边长为4的…
时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 131072K,其他语言262144K64bit IO Format: %lld 题目描述 圣诞节临近,彩虹岛的黑心商人…
题目描述:There are n cities in Byteland, and the ith city has a value ai. The cost of building a bidirectional road between two cities is the sum of their values. Please  calculate the minimum cost of connecting these cities, which means any two cities c…
链接:https://ac.nowcoder.com/acm/contest/635/D来源:牛客网 D.绕圈游戏 433为了帮ddd提升智商,决定陪他van特殊的游戏.433给定一个带有n个点的环,游戏从1号点开始,433选择任意一个K值(1<=K<=n),意味着ddd可以每次前进K个单位,当ddd再次到达1号点时游戏结束.智商为负数的ddd并不觉得这有什么难度,这时433一脸坏笑的告诉ddd,游戏的真正目的是:有任意K,满足1<=K<=n,求从开始到结束的所有情况的点数和.例如…
链接:https://www.nowcoder.com/acm/contest/89/A 来源:牛客网 1.题目描述 The Great Wall story of Meng Jiangnv’s Bitter Weeping happened during the Qin Dynasty (221BC- 206BC). Meng jiangnv was a beauty in the Qin Dynasty, and she lived happily with her husband. At…
链接:https://www.nowcoder.com/acm/contest/125/A来源:牛客网 Tony and Macle are good friends. One day they joined a birthday party together. Fortunately, they got the opportunity to have dinner with the princess, but only one person had the chance. So they de…