Codeforces 677A Vanya and Fence

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/polanwind/article/details/84075787
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <string>
#include <cstdio>

using namespace std;

int main() {
	int n, h;
	cin >> n >> h;
	int ans = 0;
	int a;
	for (int i = 1;i <= n;++i) {
		scanf("%d", &a);
		if (a <= h) {
			ans++;
		}
		else {
			ans += 2;
		}
	}
	cout << ans << endl;
	//system("pause");
	return 0;
}

猜你喜欢

转载自blog.csdn.net/polanwind/article/details/84075787