569 subscribers
2 files
52 links
Here I will Share some Very good competitve Programming Tips , Contest Problem Solution and question solution from codechef and codeforces.Stay connected Share with Your Buddy.
Happy Coding
Download Telegram
October Lunchtime 2020 (3h)
starts in 2d 7h 21m

Codeforces Round #680 (Div. 2, based on Moscow Team Olympiad) (2h)
starts in 3d 4h 26m

Codeforces Round #680 (Div. 1, based on Moscow Team Olympiad) (2h)
starts in 3d 4h 26m

Codeforces Round #681 (Div. 2, based on VK Cup 2019-2020 - Final) (2h)
starts in 4d 7h 56m

Codeforces Round #681 (Div. 1, based on VK Cup 2019-2020 - Final) (2h)
starts in 4d 7h 56m

SRM 793 (2h)
starts in 6d 19h 21m

Kotlin Heroes 5: ICPC Round (Practice) (168h)
starts in 7d 6h 56m

And other 1 scheduled in the next 2 weeks...
hello guys its lunchtime
have a great lunch
https://www.codechef.com/LTIME89B
#include <bits/stdc++.h>
using namespace std;
#define int long long int
bool cmp(int a,int b){
if(a>b){
return true;
}
else{
return false;
}
}
int32_t main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int t;
cin>>t;
while(t--){
int n,x;
cin>>n>>x;
vector<int > v1;
vector<int > v2;
for(int i=0;i<n;i++){
int k;
cin>>k;
v1.push_back(k);
}
for(int i=0;i<n;i++){
int k;
cin>>k;
v2.push_back(k);
}
// sort(v1.begin(),v1.end());
sort(v2.begin(),v2.end());
int j=n-1;
bool check=true;
for(int i=0;i<n;i++){
if(v1[i]+v2[j]>x){
cout<<"NO"<<endl;
check=false;
break;

}
j--;

}
if(check){
cout<<"YES"<<endl;
}





}

}



First question solution
#include <bits/stdc++.h>
using namespace std;
#define int long long int
bool cmp(int a,int b){
if(a>b){
return true;
}
else{
return false;
}
}
int32_t main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int t;
cin>>t;
while(t--){
int a,b,c,d;
cin>>a>>b>>c>>d;
cout<<max((a+b),(c+d))<<endl;

}

}


2nd question solution
dont forget div 2 contest
1 min left
#include <bits/stdc++.h>
using namespace std;
#define int long long int
int32_t main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int t;
cin>>t;
while(t--){
int n;
cin>>n;
int k=4*n;
for(int i=1;i<=n;i++){


cout<<k<<" ";


k-=2;


}
cout<<endl;
}

return 0;
}

problem 1 solution
Code chef long challenge mai kitne question kr liye ?
Anonymous Poll
35%
2
24%
3
22%
4
5%
5
14%
Sare kar liye
Happy dewali