Skip to content

Commit 6766dfa

Browse files
committed
Added 677A - Vanya and Fence.cpp
1 parent d31ae57 commit 6766dfa

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

677A - Vanya and Fence.cpp

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#include<bits/stdc++.h>
2+
using namespace std;
3+
4+
// Code Written By: Vikash Patel
5+
6+
int main()
7+
{
8+
int n,h;
9+
cin>>n>>h;
10+
int heights[n];
11+
int width=0;
12+
for(int i=0;i<n;i++)
13+
{
14+
cin>>heights[i];
15+
if(heights[i]<=h)
16+
width++;
17+
else
18+
width+=2;
19+
}
20+
cout<<width<<endl;
21+
}

0 commit comments

Comments
 (0)