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 7d78c18 commit 3ff65f8Copy full SHA for 3ff65f8
1550A - Find The Array.cpp
@@ -0,0 +1,42 @@
1
+// ॐ नमः शिवाय
2
+#include<bits/stdc++.h>
3
+using namespace std;
4
+
5
+#define ll long long
6
+#define pb push_back
7
+#define ff first
8
+#define ss second
9
+#define mp make_pair
10
11
+// Code Written By: Vikash Patel
12
+// Codeforces Profile: https://codeforces.com/profile/vikashpatel
13
14
+int main()
15
+{
16
+ ios_base::sync_with_stdio(0);
17
+ cin.tie(0);
18
+ cout.tie(0);
19
20
+ // #ifndef ONLINE_JUDGE
21
+ // freopen("input.txt", "r", stdin);
22
+ // freopen("/Users/vikash/Desktop/output.txt", "w", stdout);
23
+ // #endif
24
25
+ int t;
26
+ cin>>t;
27
+ while(t--)
28
+ {
29
+ int s;
30
+ cin>>s;
31
+ int c = 0;
32
+ int i = 1;
33
+ while(s>0)
34
35
+ c++;
36
+ s -= i;
37
+ i += 2;
38
+ }
39
+ cout<<c<<endl;
40
41
+ return 0;
42
+}
0 commit comments