We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5139f04 commit e143880Copy full SHA for e143880
32A - Reconnaissance.cpp
@@ -0,0 +1,25 @@
1
+#include<bits/stdc++.h>
2
+using namespace std;
3
+
4
+// Code Written By: Vikash Patel
5
6
+int main()
7
+{
8
+ int n,d;
9
+ cin>>n>>d;
10
+ int heights[n];
11
+ for(int i=0;i<n;i++)
12
+ {
13
+ cin>>heights[i];
14
+ }
15
+ int ans=0;
16
+ for(int j=0;j<n;j++)
17
18
+ for(int k=0;k<n;k++)
19
20
+ if(abs(heights[j]-heights[k])<=d && j!=k)
21
+ ans++;
22
23
24
+ cout<<ans<<endl;
25
+}
0 commit comments