-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDAy_14.cpp
67 lines (41 loc) · 966 Bytes
/
DAy_14.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*
Name - Himanshu Pokhriyal
DAte - 8 April , 2024
Version - C++ 17
Question -1 Good Investment or Not
Link --https://www.codechef.com/practice/course/basic-programming-concepts/DIFF500/problems/INVESTMENT
Apprach & Solution:
#include <bits/stdc++.h>
using namespace std;
int main() {
// your code goes here
int t ,x,y;
cin>>t;
while(t--){
cin>>x>>y;
if(x>=2*y){
cout<<"YES"<<endl;
}
else{
cout<<"NO"<<endl;
}
}
}
Time Complexity - O(t)
Space Complexity - O(1)
Question -2 Final Population
Link - https://www.codechef.com/practice/course/basic-programming-concepts/DIFF500/problems/POPULATION
#include <bits/stdc++.h>
using namespace std;
int main() {
// your code goes here
int t,x,y,z;
cin>>t;
while(t--){
cin>>x>>y>>z;
cout<<(x-y+z)<<endl;
}
}
Time Complexity - O(t)
Space Complexity - O(1)
*/