Codeforces Round #355 (Div. 2) A. Vanya and Fence 水题

时间:2023-01-16 13:01:38

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 &num;355 &lpar;Div&period; 2&rpar; C&period; Vanya and Label 水题

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

  2. Codeforces Round &num;308 &lpar;Div&period; 2&rpar; D&period; Vanya and Triangles 水题

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

  3. Codeforces Round &num;280 &lpar;Div&period; 2&rpar; A&period; 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 &num;297 &lpar;Div&period; 2&rpar;A&period; Vitaliy and Pie 水题

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

  5. Codeforces Round &num;355 &lpar;Div&period; 2&rpar; B&period; Vanya and Food Processor 水题

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

  6. Codeforces Round &num;290 &lpar;Div&period; 2&rpar; A&period; Fox And Snake 水题

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

  7. Codeforces Round &num;322 &lpar;Div&period; 2&rpar; A&period; Vasya the Hipster 水题

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

  8. Codeforces Round &num;373 &lpar;Div&period; 2&rpar; B&period; Anatoly and Cockroaches 水题

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

  9. Codeforces Round &num;368 &lpar;Div&period; 2&rpar; A&period; Brain&&num;39&semi;s Photos 水题

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

随机推荐

  1. Android视图状态及重绘流程分析,带你一步步深入了解View&lpar;三&rpar;

    转载请注明出处:http://blog.csdn.net/guolin_blog/article/details/17045157 在前面一篇文章中,我带着大家一起从源码的层面上分析了视图的绘制流程, ...

  2. PS去掉图片上的文字的6种基本方法,动态教程

    1.使用仿制图章工具去除文字这是比较常用的方法.具体的操作是,选取仿制图章工具,按住Alt键,在无文字区域点击相似的色彩或图案采样,然后在文字区域拖动鼠标复制以复盖文字.要注意的是,采样点即为复制的起 ...

  3. java&plus;内存分配及变量存储位置的区别&lbrack;转&rsqb;

    原文来自:http://blog.csdn.net/rj042/article/details/6871030#comments Java内存分配与管理是Java的核心技术之一,之前我们曾介绍过Jav ...

  4. Eclipse 安装对 Java 8 的支持

    Java 8 正式版今天已经发布了(详情),但最常用的 Java 开发工具 Eclipse 还没有正式发布对 Java 8 的支持.不过目前可以通过更新 JDT 来支持 Java 8.步骤如下: 菜单 ...

  5. keil采用C语言模块化编程时全局变量、结构体的定义、声明以及头文件包含的处理方法

    以前写单片机程序时总是把所用函数和变量都写在一个c文件里,后来遇到大点的项目,程序动则几千行,这种方式无疑会带来N多麻烦,相信大家都有所体验吧! 后来学会了在keil里进行模块化编程,即只把功能相同或 ...

  6. vue&plus;element-ui之tree树形控件有关子节点和父节点之间的各种选中关系详解

    做后端管理系统,永远是最蛋疼.最复杂也最欠揍的事情,也永远是前端开发人员最苦逼.最无奈也最尿性的时刻.蛋疼的是需求变幻无穷,如同二师兄的三十六般变化:复杂的是开发难度寸步难行,如同蜀道难,难于上青天: ...

  7. Gradle 学习二

    按照本指南,您将创建一个简单的Gradle项目,调用一些基本的Gradle命令,并了解Gradle如何管理项目 1.初始化项目创建项目目录 ❯ mkdir basic-demo ❯ cd basic- ...

  8. Python中数学函数

    1.不需要引入math模块的有: abs(),cmp(),max(),min(),pow(),round() 2.需要引入math模块的: 三角函数,及其他数学函数,fabs(), *需要特别注意: ...

  9. linux程序一般设置

    看canal的时候看了下deploy的脚本,发现很多系统都大同小异 如果是需要debug,就需要开启调试端口 if [ "$1" = "debug" ]; th ...

  10. ES6常用特性总览

    以前看过一遍es6,今天面试时被问到了一个很简单的es6特性,竟然没回答上来,特来重温一下es6,做个总结性笔记. 一.什么是es6 es6是新版本JavaScript语言的标准,在2015年6月发布 ...