5 条题解

  • 1
    @ 2020-12-21 11:20:44

    对新增的高度求和:H=(n+1)*n/2
    H+3=x -> 1/2*n^2+1/2*n-(x-3)=0
    对此二次方程求根取正数解:n=(2*x+1/4)^(1/2)-1/2
    再向上取整得到结果.代码如下

    import math
    x=int(input())
    print(math.ceil(math.sqrt(1.0/4.0+2.0*(x-3))-1.0/2.0))
    
    
    
  • 1
    @ 2020-01-29 19:13:58

    a=int(input())
    b=c=0
    while(b<a-3):
    c+=1
    b=b+c
    print(c)

  • 0
    @ 2023-09-23 18:14:29

    挑战最短a.a

    import math
    print(math.ceil(math.sqrt(float(input())*2-5.75)-0.5))
    
  • 0
    @ 2020-09-13 21:15:56

    m=int(input())#最后长度
    n=3
    d=0#天数
    while n<m:
    d=d+1
    n=n+d
    print(d)

  • 0
    @ 2020-06-10 16:31:16

    m=int(input())
    m>=3
    n=0
    a=(n+1)*n/2
    while a<m-3:
    n=n+1
    a=(n+1)*n/2
    print(n)

  • 1

信息

ID
1020
难度
8
分类
(无)
标签
(无)
递交数
720
已通过
102
通过率
14%
被复制
1
上传者