15 条题解

  • 4
    @ 2019-10-24 10:23:54
    import math
    a=int(input())
    if a<=6:
        print("3")
    elif a>6 and a<=12:
        print("4")
    elif a>12 and a<=22:
        print("5")
    elif a>22 and a<=32:
        print("6")
    elif a>32:
        b=(a-32)/20
        c=math.ceil(b)
        print(c+6)
    
  • 2
    @ 2018-11-26 10:49:23

    import math
    a=int(input())
    if a<=6:
    print(3)
    elif a<=12:
    print(4)
    elif a<=32:
    print(6+math.ceil((a-32)/10))
    else:
    print(6+math.ceil((a-32)/20))

  • 1
    @ 2023-09-24 19:17:50

    数据弱到打表都能过。。。

    l=[3,3,3,3,3,3,3,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11]
    print(l[int(input())])
    
  • 1
    @ 2019-03-06 17:25:52

    mport math
    a=int(input())
    if a<=6:
    print(3)
    elif a<=12:
    print(4)
    elif a<=22:
    print(5)
    elif a<=32:
    print(6)
    else:
    print(6+math.ceil((a-32)/20))

  • 1
    @ 2019-03-04 16:15:00

    import math
    a=int(input())

    b=math.ceil((a-32)/20)+6
    if a<=6:
    print(3)
    elif a>6 and a<=12:
    print(4)
    elif a>12 and a<=22:
    print(5)
    elif a>22 and a<=32:
    print(6)
    else:
    print(b)

  • 1
    @ 2018-11-25 21:43:07

    见识一下什么叫暴力算法
    仅限娱乐

    #include <stdio.h>
    #include<iostream>
    //C++
    using namespace std;
    int main()
    {
        int a;
        cin>>a; 
        if(a<=6){cout<<"3";return 0;}
        else if(a<=12){cout<<"4";return 0;}
        else if(a<=22){cout<<"5";return 0;}
        else if(a<=32){cout<<"6";return 0;}
        else if(a<=52){cout<<"7";return 0;}
        else if(a<=72){cout<<"8";return 0;}
        else if(a<=92){cout<<"9";return 0;}
        else if(a<=102){cout<<"10";return 0;}
        else if(a<=122){cout<<"11";return 0;}
    /*当然要娱乐一下了,所以直接注释
        else{
            a-=32;
            int k=0;
            if(a<20){
                cout<<"7";return 0;
            }
            while(a>=20){
                a-=20;
                k++;
            }
            cout<<k;
        }*/
    }
    
    
    • @ 2019-03-05 10:58:56

      92~112公里是10块嘿

  • 0
    @ 2021-10-18 11:16:32

    #不需要向上取整函数的题解
    s=int(input())
    if s<=6:
    m=3
    elif s>6 and s<=12:
    m=4
    elif s>12 and s<=22:
    m=5
    elif s>22 and s<=32:
    m=6
    else:
    if (s-32)%20==0:
    m=6+(s-32)//20
    else:
    m=6+((s-32)//20)+1
    print(m)

  • 0
    @ 2020-03-17 22:26:14

    import math
    m=int(input())
    if m<=6:
    print(3)
    elif m>6 and m<=12:
    print(4)
    elif m>12 and m<=22:
    print(5)
    elif m>22 and m<=32:
    print(6)
    else:
    print(6+math.ceil((m-32)/20))

  • 0
    @ 2019-03-11 15:27:54

    #include <iostream>
    #include <math.h>
    #include <iomanip>

    using namespace std;

    int main()
    {
    int length, price;
    cin >> length;
    if(length <= 6)
    {
    price = 3;
    }
    else if(length <= 12 && length > 6)
    {
    price = 4;
    }
    else if(length <= 22 && length > 12)
    {
    price = 5;
    }
    else if(length <= 32 && length > 22)
    {
    price = 6;
    }
    else
    {
    price = 6 + ceil((length - 32) / 20.0);
    }
    cout << price;
    return 0;
    }

  • 0
    @ 2019-03-05 10:59:39

    数据挺真实/斜眼笑,里程不超过112公里。
    x=int(input())
    if(x<=6):
    print(3)
    elif(x<=12):
    print(4)
    elif(x<=22):
    print(5)
    elif(x<=32):
    print(6)
    elif(x<=52):
    print(7)
    elif(x<=72):
    print(8)
    elif(x<=92):
    print(9)
    elif(x<=112):
    print(10)

  • 0
    @ 2019-03-04 16:10:44

    import math
    a=int(input())
    if a<=6:
    print(3)
    elif a<=12:
    print(4)
    elif a<=32:
    print(6+math.ceil((a-32)/10))
    else:
    print(6+math.ceil((a-32)/20))

  • 0
    @ 2018-11-26 16:21:03

    import math
    N=int(input())
    if N<=6:
    print(3)
    elif N>6 and N<=12:
    print(4)
    elif N>12 and N<=22:
    print(5)
    elif N>22 and N<=32:
    print(6)
    else:
    print(6+math.ceil((N-32)/20))

  • 0
    @ 2018-11-26 15:44:55

    import math
    s=int(input())
    if s<=6:
    print(3)
    if s>6 and s<=12:
    print(4)
    if s>12 and s<=22:
    print(5)
    if s>22 and s<=32:
    print(6)
    if s>32:
    print(6+math.ceil((s-32)/20))

  • 0
    @ 2018-11-07 10:51:14
    import math
    a=int(input())
    if a<=6:
        print(3)
    if a>6 and a<=12:
        print(4)
    if a>12 and a<=22:
        print(5)
    if a>22 and a<=32:
        print(6)
    if a>32:
        print(6+math.ceil((a-32)/20))
    
  • 0
    @ 2018-11-07 10:50:02
    import math
    a=int(input())
    if a<=6:
        print(3)
    if a>6 and a<=12:
        print(4)
    if a>12 and a<=22:
        print(5)
    if a>22 and a<=32:
        print(6)
    if a>32:
        print(6+math.ceil((a-32)/20))
    
  • 1

信息

难度
7
分类
(无)
标签
(无)
递交数
4067
已通过
723
通过率
18%
被复制
1
上传者