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
This media is not supported in your browser
VIEW IN TELEGRAM
have you tried this question ? Bandit in a city
https://codeforces.com/contest/1436/problem/D
Anonymous Poll
25%
yes
75%
no
must try this question
jldi register kr lo 5 min bache hain
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