翻滚吧牛牛(一)
比赛主页
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
Special Judge, 64bit IO Format: %lld
题目描述
有一个边长为1的正六边形,只要 一推它就可以一直滚下去,正六边形左下角为A,想知道正六边形翻滚k次A点的轨迹边长是多少呢。如图是正六边形翻滚一次的情况。给定正六边形翻滚次数k,求A点翻滚轨迹长度
示例1
输入
复制
3
3
返回值
复制
4.955392
4.955392
备注:
,返回值与答案误差应小于0.00001
翻滚吧牛牛(一)
返回全部题目
列表加载中...
import java.util.*; public class Solution { /** * * @param k int整型 翻滚次数 * @return double浮点型 */ public double circumference (int k) { // write code here } }
class Solution { public: /** * * @param k int整型 翻滚次数 * @return double浮点型 */ double circumference(int k) { // write code here } };
# # # @param k int整型 翻滚次数 # @return double浮点型 # class Solution: def circumference(self , k ): # write code here
/** * * @param k int整型 翻滚次数 * @return double浮点型 */ function circumference( k ) { // write code here } module.exports = { circumference : circumference };
# # # @param k int整型 翻滚次数 # @return double浮点型 # class Solution: def circumference(self , k ): # write code here
package main /** * * @param k int整型 翻滚次数 * @return double浮点型 */ func circumference( k int ) float64 { // write code here }
/** * * @param k int整型 翻滚次数 * @return double浮点型 */ double circumference(int k ) { // write code here }
3
4.955392