• Codeforces Round #340 (Div. 2) A


    Description

    An elephant decided to visit his friend. It turned out that the elephant's house is located at point 0 and his friend's house is located at pointx(x > 0) of the coordinate line. In one step the elephant can move 1, 2, 3, 4 or 5 positions forward. Determine, what is the minimum number of steps he need to make in order to get to his friend's house.

    Input

    The first line of the input contains an integer x (1 ≤ x ≤ 1 000 000) — The coordinate of the friend's house.

    Output

    Print the minimum number of steps that elephant needs to make to get from point 0 to point x.

    Sample test(s)
    input
    5
    12
    output
       1
    3

    真 - 水题 

    #include<stdio.h>
    //#include<bits/stdc++.h>
    #include<string.h>
    #include<iostream>
    #include<math.h>
    #include<sstream>
    #include<set>
    #include<queue>
    #include<map>
    #include<vector>
    #include<algorithm>
    #include<limits.h>
    #define inf 0x3fffffff
    #define INF 0x3f3f3f3f
    #define lson l,m,rt<<1
    #define rson m+1,r,rt<<1|1
    #define LL long long
    #define ULL unsigned long long
    using namespace std;
    int t;
    int n,m;
    int sum,ans,flag;
    int a,b,c,d;
    int main()
    {
        cin>>n;
        if(n%5==0)
        {
            cout<<n/5;
        }
        else
        {
            cout<<n/5+1;
        }
        return 0;
    }
    

      

  • 相关阅读:
    一、CentOS 7安装部署GitLab服务器

    四、指定Nginx启动用户
    三、Nginx支持php
    二、Nginx多站点配置(参考宝塔的)分析
    一、Nginx多站点配置
    一、PHP和Apache实现多用户自助建站
    Flask+uwsgi+Nginx+Ubuntu部署
    flask 上传头像
    flask 分页
  • 原文地址:https://www.cnblogs.com/yinghualuowu/p/5160229.html
Copyright © 2020-2023  润新知