Codeforces Round #340 (Div. 2) A. Elephant 水题
A. Elephant
题目连接:
http://www.codeforces.com/contest/617/problem/A
Descriptionww.co
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 point x(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 Input
6
Sample Output
2
Hint
题意
给你一个数x,然后让你输出x/5的向上取整
题解:
输出(x+4)/5就好了
代码
#include<bits/stdc++.h>
using namespace std;
int main()
{
long long x;
cin>>x;
cout<<(x+4)/5<<endl;
}
Codeforces Round #340 (Div. 2) A. Elephant 水题的更多相关文章
- Codeforces Round #340 (Div. 2) B. Chocolate 水题
B. Chocolate 题目连接: http://www.codeforces.com/contest/617/problem/D Descriptionww.co Bob loves everyt ...
- Codeforces Round #340 (Div. 2) D. Polyline 水题
D. Polyline 题目连接: http://www.codeforces.com/contest/617/problem/D Descriptionww.co There are three p ...
- Codeforces Round #185 (Div. 2) B. Archer 水题
B. Archer Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/312/problem/B D ...
- Codeforces Round #360 (Div. 2) A. Opponents 水题
A. Opponents 题目连接: http://www.codeforces.com/contest/688/problem/A Description Arya has n opponents ...
- Codeforces Round #190 (Div. 2) 水果俩水题
后天考试,今天做题,我真佩服自己... 这次又只A俩水题... orz各路神犇... 话说这次模拟题挺多... 半个多小时把前面俩水题做完,然后卡C,和往常一样,题目看懂做不出来... A: 算是模拟 ...
- Codeforces Round #256 (Div. 2/A)/Codeforces448A_Rewards(水题)解题报告
对于这道水题本人觉得应该应用贪心算法来解这道题: 下面就贴出本人的代码吧: #include<cstdio> #include<iostream> using namespac ...
- Codeforces Round #338 (Div. 2) A. Bulbs 水题
A. Bulbs 题目连接: http://www.codeforces.com/contest/615/problem/A Description Vasya wants to turn on Ch ...
- Codeforces Round #282 (Div. 1) A. Treasure 水题
A. Treasure Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/494/problem/A ...
- Codeforces Round #327 (Div. 2) B. Rebranding 水题
B. Rebranding Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/591/problem ...
随机推荐
- hql查询语句 内存中的情况,fetch迫切查询关键字
Classes.java package cn.itcast.hiberate.sh.domain; import java.io.Serializable; import java.util.Set ...
- ajax轮询
oa.comet = function (id) { if (oa.id == 0) oa.id = id; $.ajax({ url: '/comet.asy?id=' + ...
- js中document.all 的用法
1. document.all是什么? document.all 实质就是文档中所有元素的集合.可以看做一个数组. 2.document.all怎么用? 2.1 根据下标取元素. 语法: docu ...
- Initializing a Build Environment
This section describes how to set up your local work environment to build the Android source files. ...
- eclipse手动导入dtd文件
1.在eclipse的工具栏上按照“Window->Preferences->XML->XML Catalog”依次点下去,然后在右侧选中 User Specified Entrie ...
- openGl从零开始之添加颜色
OpenGL 支持两种颜色模式:一种是 RGBA模式,一种是 颜色索引模式.无论哪种颜色模式,计算机都必须为每一个像素保存一些数据,即通过每一个像素的颜色,来改变整体图形的颜色.不同的是, RGBA ...
- CRF模型
CRF的全称是Conditional Random Fields,由CMU教授John Lafferty 提出,原文标题:Conditional R andom Fields: Probabilist ...
- Matlab命令——目录操作(windows&Linux)
Matlab命令——目录操作(windows&Linux) 1. filesep用于返回当前平台的目录分隔符,Windows是反斜杠(\),Linux是斜杠(/).有时此命令结合ispc命令使 ...
- 【LeetCode】242 - Valid Anagram
Given two strings s and t, write a function to determine if t is an anagram of s. For example,s = &q ...
- C字符串和C++中string的区别 &&&&C++中int型与string型互相转换
在C++中则把字符串封装成了一种数据类型string,可以直接声明变量并进行赋值等字符串操作.以下是C字符串和C++中string的区别: C字符串 string对象(C++) 所需的头文件名称 ...