๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
Photo
#include<bits/stdc++.h>
using namespace std;
int main() {
int n,c,d ;
cin>>n>>c>>d ;
int b[n],p[n],t[n] ;
for(int i=0;i<n;i++)
cin>>b[i]>>p[i]>>t[i] ;
vector<pair<int,int>>type_0,type_1 ;
for(int i=0;i<n;i++)
{
if(t[i]==0)
{
type_0.push_back({p[i],b[i]}) ;
}
else
{
type_1.push_back({p[i],b[i]}) ;
}
}
sort(type_0.begin(),type_0.end()) ;
sort(type_1.begin(),type_1.end()) ;
// One using coins and one using diamonds
int max_0=0,max_1=0 ;
int x=type_0.size() ;
int y=type_1.size() ;
for(int i=0;i<x;i++)
{
if(type_0[i].first<=c)
max_0=max(max_0,type_0[i].second) ;
}
for(int i=0;i<y;i++)
{
if(type_1[i].first<=d)
max_1=max(max_1,type_1[i].second) ;
}
int ans=0 ;
if(max_0&&max_1)
ans=max(ans,max_0+max_1) ;
// Both using coins
multiset<int>m;
for(int i=0;i<x;i++)
{
m.insert(type_0[i].second) ;
}
int j=type_0.size()-1 ;
for(int i=0;i<x;i++)
{
if(j<=i)
break ;
auto it=m.find(type_0[i].second) ;
m.erase(it) ;
int flag=0 ;
while(j>i)
{
if(type_0[j].first+type_0[i].first<=c)
{
flag=1 ;
break ;
}
auto it=m.find(type_0[j].second) ;
m.erase(it) ;
j-- ;
}
if(flag==0)
break ;
if(m.size())
ans=max(ans,type_0[i].second+*m.rbegin()) ;
}
// Both using diamonds
m.clear() ;
for(int i=0;i<y;i++)
{
m.insert(type_1[i].second) ;
}
j=type_1.size()-1 ;
for(int i=0;i<y;i++)
{
if(j<=i)
break ;
auto it=m.find(type_1[i].second) ;
m.erase(it) ;
int flag=0 ;
while(j>i)
{
if(type_1[j].first+type_1[i].first<=d)
{
flag=1 ;
break ;
}
auto it=m.find(type_1[j].second) ;
m.erase(it) ;
j-- ;
}
if(flag==0)
break ;
if(m.size())
ans=max(ans,type_1[i].second+*m.rbegin()) ;
}
cout<<ans<<"\n" ;
return 0;
}
Uber โ
using namespace std;
int main() {
int n,c,d ;
cin>>n>>c>>d ;
int b[n],p[n],t[n] ;
for(int i=0;i<n;i++)
cin>>b[i]>>p[i]>>t[i] ;
vector<pair<int,int>>type_0,type_1 ;
for(int i=0;i<n;i++)
{
if(t[i]==0)
{
type_0.push_back({p[i],b[i]}) ;
}
else
{
type_1.push_back({p[i],b[i]}) ;
}
}
sort(type_0.begin(),type_0.end()) ;
sort(type_1.begin(),type_1.end()) ;
// One using coins and one using diamonds
int max_0=0,max_1=0 ;
int x=type_0.size() ;
int y=type_1.size() ;
for(int i=0;i<x;i++)
{
if(type_0[i].first<=c)
max_0=max(max_0,type_0[i].second) ;
}
for(int i=0;i<y;i++)
{
if(type_1[i].first<=d)
max_1=max(max_1,type_1[i].second) ;
}
int ans=0 ;
if(max_0&&max_1)
ans=max(ans,max_0+max_1) ;
// Both using coins
multiset<int>m;
for(int i=0;i<x;i++)
{
m.insert(type_0[i].second) ;
}
int j=type_0.size()-1 ;
for(int i=0;i<x;i++)
{
if(j<=i)
break ;
auto it=m.find(type_0[i].second) ;
m.erase(it) ;
int flag=0 ;
while(j>i)
{
if(type_0[j].first+type_0[i].first<=c)
{
flag=1 ;
break ;
}
auto it=m.find(type_0[j].second) ;
m.erase(it) ;
j-- ;
}
if(flag==0)
break ;
if(m.size())
ans=max(ans,type_0[i].second+*m.rbegin()) ;
}
// Both using diamonds
m.clear() ;
for(int i=0;i<y;i++)
{
m.insert(type_1[i].second) ;
}
j=type_1.size()-1 ;
for(int i=0;i<y;i++)
{
if(j<=i)
break ;
auto it=m.find(type_1[i].second) ;
m.erase(it) ;
int flag=0 ;
while(j>i)
{
if(type_1[j].first+type_1[i].first<=d)
{
flag=1 ;
break ;
}
auto it=m.find(type_1[j].second) ;
m.erase(it) ;
j-- ;
}
if(flag==0)
break ;
if(m.size())
ans=max(ans,type_1[i].second+*m.rbegin()) ;
}
cout<<ans<<"\n" ;
return 0;
}
Uber โ
โค1
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Zoho | SDE | 2024, 2023, 2022 Grads
https://careers.zohocorp.com/forms/fcc89b5ebd373d598e0224d10f2199d1d818f12a6a00e375c49160b9189518c4
https://careers.zohocorp.com/forms/fcc89b5ebd373d598e0224d10f2199d1d818f12a6a00e375c49160b9189518c4
๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
#include<bits/stdc++.h> using namespace std; string str, bad_string; struct node{ bool end_mark; node *next[10]; node() { end_mark = false; for(int i = 0; i<10; i++) next[i] = NULL; } }*root; bool add(stringโฆ
Good set Bad set โ
Uber
Uber
๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
#include <bits/stdc++.h> using namespace std; const int MOD = 1e9 + 7; long long solution(int n, vector<long long>& a, vector<long long>& b) { long long ans = 0; int minP = min_element(a.begin(), a.end()) - a.begin(); int minQ = min_element(b.begin()โฆ
Professor Code
Uber โ
Uber โ
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Hiringalert !
Job openings for Administration Executive profile,
MBA Fresher with specialisation in Finance and Marketing
Location -Greater Noida (WFO)
Skills- Tally, Advance Excel etc.
Interested candidates can share cv on career@pharmazz.com
Job openings for Administration Executive profile,
MBA Fresher with specialisation in Finance and Marketing
Location -Greater Noida (WFO)
Skills- Tally, Advance Excel etc.
Interested candidates can share cv on career@pharmazz.com
๐1
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company Name: Rupeek
๐ Job Title: Intern
โ๐ป YOE: 2023 and 2024 grads
โก๏ธ Apply: https://docs.google.com/forms/d/e/1FAIpQLSceMkw-xt08jB5wGYPXhgJ1lGhBwn57E9NfYN6aOVy-bDKKpg/viewform
Please do share in your college grps and in case you are applying please react on this post:) ๐โค๏ธ
๐ Job Title: Intern
โ๐ป YOE: 2023 and 2024 grads
โก๏ธ Apply: https://docs.google.com/forms/d/e/1FAIpQLSceMkw-xt08jB5wGYPXhgJ1lGhBwn57E9NfYN6aOVy-bDKKpg/viewform
Please do share in your college grps and in case you are applying please react on this post:) ๐โค๏ธ
๐1
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company Name: ServiceNow
๐ Job Title: Software Engineer (UI)
โ๐ป YOE: 2022 and 2023 grads
โก๏ธ Apply: https://careers.servicenow.com/jobs/743999986041623/software-engineer-ui-developer/
Please do share in your college grps and in case you are applying please react on this post:) ๐โค๏ธ
๐ Job Title: Software Engineer (UI)
โ๐ป YOE: 2022 and 2023 grads
โก๏ธ Apply: https://careers.servicenow.com/jobs/743999986041623/software-engineer-ui-developer/
Please do share in your college grps and in case you are applying please react on this post:) ๐โค๏ธ
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Genpact is seeking MBA freshers for the role of Recruitment Consultant in Noida.
This is a wonderful opportunity for those who want to start their career in the field of recruitment.
The role requires working from the office for 5 days a week.
If you're interested, kindly send your updated resume to faaiza.fatima@genpact.com or drop a comment/message.
We look forward to hearing from you!
This is a wonderful opportunity for those who want to start their career in the field of recruitment.
The role requires working from the office for 5 days a week.
If you're interested, kindly send your updated resume to faaiza.fatima@genpact.com or drop a comment/message.
We look forward to hearing from you!
๐1
List<Character> duplicates = new ArrayList<>();
for (int i = 0; i < inputchar.size(); i++) {
for (int j = i + 1; j < inputchar.size(); j++) {
if (inputchar.get(i).equals(inputchar.get(j)) && !duplicates.contains(inputchar.get(i))) {
duplicates.add(inputchar.get(i));
break;
}
}
}
return duplicates;
}
Program to find duplicate in element Array โ
IBM
for (int i = 0; i < inputchar.size(); i++) {
for (int j = i + 1; j < inputchar.size(); j++) {
if (inputchar.get(i).equals(inputchar.get(j)) && !duplicates.contains(inputchar.get(i))) {
duplicates.add(inputchar.get(i));
break;
}
}
}
return duplicates;
}
Program to find duplicate in element Array โ
IBM