A. Vanya and Fence

题目连接:

http://www.codeforces.com/contest/677/problem/A

Description

Vanya and his friends are walking along the fence of height h and they do not want the guard to notice them. In order to achieve this the height of each of the friends should not exceed h. If the height of some person is greater than h he can bend down and then he surely won't be noticed by the guard. The height of the i-th person is equal to ai.

Consider the width of the person walking as usual to be equal to 1, while the width of the bent person is equal to 2. Friends want to talk to each other while walking, so they would like to walk in a single row. What is the minimum width of the road, such that friends can walk in a row and remain unattended by the guard?

Input

The first line of the input contains two integers n and h (1 ≤ n ≤ 1000, 1 ≤ h ≤ 1000) — the number of friends and the height of the fence, respectively.

The second line contains n integers ai (1 ≤ ai ≤ 2h), the i-th of them is equal to the height of the i-th person.

Output

Print a single integer — the minimum possible valid width of the road.

Sample Input

3 7

4 5 14

Sample Output

4

Hint

题意

身高不超过h的话,一般只会占1的宽度,超过的话,体型占2的宽度

问你n个人,要站成一排的话,最少要多少宽度

题解:

水题……

代码

#include<bits/stdc++.h>
using namespace std;
int n,h,x,ans;
int main()
{
scanf("%d%d",&n,&h);
for(int i=1;i<=n;i++)
{
scanf("%d",&x);
ans++;
if(x>h)ans++;
}
cout<<ans<<endl;
}

Codeforces Round #355 (Div. 2) A. Vanya and Fence 水题的更多相关文章

  1. Codeforces Round #355 (Div. 2) C. Vanya and Label 水题

    C. Vanya and Label 题目连接: http://www.codeforces.com/contest/677/problem/C Description While walking d ...

  2. Codeforces Round #308 (Div. 2) D. Vanya and Triangles 水题

    D. Vanya and Triangles Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/55 ...

  3. Codeforces Round #280 (Div. 2) A. Vanya and Cubes 水题

    A. Vanya and Cubes time limit per test 1 second memory limit per test 256 megabytes input standard i ...

  4. Codeforces Round #297 (Div. 2)A. Vitaliy and Pie 水题

    Codeforces Round #297 (Div. 2)A. Vitaliy and Pie Time Limit: 2 Sec  Memory Limit: 256 MBSubmit: xxx  ...

  5. Codeforces Round #355 (Div. 2) B. Vanya and Food Processor 水题

    B. Vanya and Food Processor 题目连接: http://www.codeforces.com/contest/677/problem/B Description Vanya ...

  6. Codeforces Round #290 (Div. 2) A. Fox And Snake 水题

    A. Fox And Snake 题目连接: http://codeforces.com/contest/510/problem/A Description Fox Ciel starts to le ...

  7. Codeforces Round #322 (Div. 2) A. Vasya the Hipster 水题

    A. Vasya the Hipster Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/581/p ...

  8. Codeforces Round #373 (Div. 2) B. Anatoly and Cockroaches 水题

    B. Anatoly and Cockroaches 题目连接: http://codeforces.com/contest/719/problem/B Description Anatoly liv ...

  9. Codeforces Round #368 (Div. 2) A. Brain's Photos 水题

    A. Brain's Photos 题目连接: http://www.codeforces.com/contest/707/problem/A Description Small, but very ...

随机推荐

  1. Kettle进行数据迁移(ETL)

    由于开发新的系统,需要将之前一个老的C/S应用的数据按照新的数据设计导入到新库中.此过程可能涉及到表结构不一致.大数据量(千万级,甚至上亿)等情况,包括异构数据的抽取.清洗等等工作.部分复杂的工作需要 ...

  2. 01.Web基础和HTML初始

    1.1 上网就是请求数据 我们先不直接解决这个问题,我们做一个小实验.我们每个人的电脑里面,都有一个神秘的文件夹: C:\Users\Weiheng\AppData\Local\Microsoft\W ...

  3. Mysql Limit操作

    oracle : ||   mysql: contact    contact_ws 拼接   Font Size: Large | Medium | Small select * from tabl ...

  4. Docker - CentOS安装Docker

    如果要在CentOS下安装Docker容器,必须是CentOS 7 (64-bit).CentOS 6.5 (64-bit) 或更高的版本,并要求 CentOS 系统内核高于 3.10. uname ...

  5. java基础34 泛型的使用

    本文知识点(目录): 1.泛型的好处    2.泛型在集合中的常见应用(这里只用String类型举例)    3.在泛型中是不能使用基本数据类型,如果需要使用基本数据类型,那么就使用基本数据类型对应的 ...

  6. javaweb 要学习的东西

    我学院课设是Javaweb程序,要用eclipse,tomcat,jbdc,和数据库 jbdc,是连接数据库的驱动,tomcat是一种类似于服务器的东西,现在买不起服务器,就用tomcat

  7. SpringCloud Config Bus webhook 只能刷新config server 不能刷新config client

    在 https://github.com/spring-cloud/spring-cloud-bus/issues/124 中有提到 版本 SpringCloud:Greenwich.RC1 原因 由 ...

  8. TIAGo ROS模拟教程2 - 自主机器人导航

    TIAGo ROS Simulation Tutorial 2 – Autonomous robot navigation TIAGo ROS模拟教程2 - 自主机器人导航 发表于 12月 23,20 ...

  9. css 让背景图片不停旋转

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  10. SQL Server日期计算

    通常,你需要获得当前日期和计算一些其他的日期,例如,你的程序可能需要判断一个月的第一天或者最后一天.你们大部分人大概都知道怎样把日期进行分割(年.月.日等),然后仅仅用分割出来的年.月.日等放在几个函 ...