-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathday_36.cpp
60 lines (45 loc) · 990 Bytes
/
day_36.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
/*
Name - Himanshu Pokhriyal
DAte - 30 April , 2024
Version -- C++17
Ques-1 Qualify the round
Link - https://www.codechef.com/practice/course/logical-problems/DIFF800/problems/QUALIFY
#include <bits/stdc++.h>
using namespace std;
int main() {
// your code goes here
int t;
cin>>t;
while ( t-- ){
int x,a,b;
cin>>x>>a>>b;
if(a+2*b>=x) cout<<"Qualify"<<endl;
else cout<<"NotQualify"<<endl;
}
}
Time complexity - O(t)
Space complexity- O(1)
Ques-2 Elections in Chefland
Link - https://www.codechef.com/practice/course/logical-problems/DIFF800/problems/ELECTN
#include <bits/stdc++.h>
using namespace std;
int main() {
// your code goes here
int t;
cin>>t;
while( t-- ){
int n,x;
cin>>n>>x;
int i=0;
int cnt=0;
while( n != 0){
cin>>i;
if(i>=x) cnt++;
n--;
}
cout<<cnt<<endl;
}
}
Time complexity - O(t)
Space complexity- O(1)
*/