๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
Photo
#include<bits/stdc++.h>
using namespace std;
vector<int> solve(int N, vector<int> a, int q, vector<vector<int>> queries) {
vector<int> res;
for(int i=0; i<q; i++) {
int T = queries[i][0];
int l = queries[i][1];
int r = queries[i][2];
int x = queries[i][3];
if(T == 1) {
int ans = a[l-1];
for(int j=l; j<r; j++) {
ans |= a[j];
}
res.push_back(ans);
} else {
for(int j=l-1; j<r; j++) {
a[j] ^= x;
}
}
}
return res;
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int N;
cin>>N;
vector<int> a(N);
for(int i=0; i<N; i++) {
cin>>a[i];
}
int q;
cin>>q;
vector<vector<int>> queries(q, vector<int>(4));
for(int i=0; i<q; i++) {
for(int j=0; j<4; j++) {
cin>>queries[i][j];
}
}
vector<int> res = solve(N, a, q, queries);
for(int i=0; i<res.size(); i++) {
cout<<res[i]<<" ";
}
cout<<endl;
return 0;
}
Array bitwise operationsโ
using namespace std;
vector<int> solve(int N, vector<int> a, int q, vector<vector<int>> queries) {
vector<int> res;
for(int i=0; i<q; i++) {
int T = queries[i][0];
int l = queries[i][1];
int r = queries[i][2];
int x = queries[i][3];
if(T == 1) {
int ans = a[l-1];
for(int j=l; j<r; j++) {
ans |= a[j];
}
res.push_back(ans);
} else {
for(int j=l-1; j<r; j++) {
a[j] ^= x;
}
}
}
return res;
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int N;
cin>>N;
vector<int> a(N);
for(int i=0; i<N; i++) {
cin>>a[i];
}
int q;
cin>>q;
vector<vector<int>> queries(q, vector<int>(4));
for(int i=0; i<q; i++) {
for(int j=0; j<4; j++) {
cin>>queries[i][j];
}
}
vector<int> res = solve(N, a, q, queries);
for(int i=0; i<res.size(); i++) {
cout<<res[i]<<" ";
}
cout<<endl;
return 0;
}
Array bitwise operationsโ
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company Name: Alakmalak Technologies
Role: Software Developer
Batch eligible: 2023 and 2024 passouts
Apply: https://bit.ly/3H8Dxf8
Role: Software Developer
Batch eligible: 2023 and 2024 passouts
Apply: https://bit.ly/3H8Dxf8
Codingninjas
Coding Ninjas Studio Weekend Contest 107 Coding Contest- Coding Ninjas
Level up your coding skills and quickly land a job with the Coding Ninjas Studio Contests every week. Compete and see your ranking!
Game streaming service โ
E commerce โ
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company Name: Coinbase
Role: Software Engineer
Batch eligible: 2022 and 2023 passouts
Apply: https://www.coinbase.com/en-gb/careers/positions/5598961?gh_jid=5598961&gh_src=20687b321us%E2%80%A6
Role: Software Engineer
Batch eligible: 2022 and 2023 passouts
Apply: https://www.coinbase.com/en-gb/careers/positions/5598961?gh_jid=5598961&gh_src=20687b321us%E2%80%A6
Coinbase
Software Engineer, Backend - International, Remote - India - Coinbase
Coinbase is a secure online platform for buying, selling, transferring, and storing cryptocurrency.
Saks subarray productโ
long long solve(vector<int>& nums, int k) {
if (k <= 1) return 0;
int n = nums.size();
long long p = 1;
int i = 0, j = 0;
long long ans = 0;
while (j < n) {
p *= nums[j];
while (i <= j && p > k) {
p /= nums[i];
i++;
}
ans += j - i + 1;
j++;
}
return ans;
}
long long solve(vector<int>& nums, int k) {
if (k <= 1) return 0;
int n = nums.size();
long long p = 1;
int i = 0, j = 0;
long long ans = 0;
while (j < n) {
p *= nums[j];
while (i <= j && p > k) {
p /= nums[i];
i++;
}
ans += j - i + 1;
j++;
}
return ans;
}
int solve(int N, int M, vector<int>& plates) {
sort(plates.begin(), plates.end());
int left = 0, right = 1e9+7;
while (left < right) {
int mid = left + (right - left + 1) / 2;
int sum = 0;
for (int i = N - 1; i >= 0 && plates[i] >= mid; i--) {
sum += plates[i] - mid;
if (sum >= M) break;
}
if (sum >= M) left = mid;
else right = mid - 1;
}
return left;
}
Thanksgiving โ
sort(plates.begin(), plates.end());
int left = 0, right = 1e9+7;
while (left < right) {
int mid = left + (right - left + 1) / 2;
int sum = 0;
for (int i = N - 1; i >= 0 && plates[i] >= mid; i--) {
sum += plates[i] - mid;
if (sum >= M) break;
}
if (sum >= M) left = mid;
else right = mid - 1;
}
return left;
}
Thanksgiving โ
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
๐Alight is Hiring !!
Role: Graduate Engineer Trainee
Expected CTC: 4-8 LPA
Location: Hyderabad
Apply here: https://careers.alight.com/us/en/job/ALIGUSR26847EXTERNALENUS/Graduate-Engineer-Trainee
Role: Graduate Engineer Trainee
Expected CTC: 4-8 LPA
Location: Hyderabad
Apply here: https://careers.alight.com/us/en/job/ALIGUSR26847EXTERNALENUS/Graduate-Engineer-Trainee
Alight
Graduate Engineer Trainee in Hyderabad, Telangana, India | Infrastructure Services at Alight
Apply for Graduate Engineer Trainee job with Alight in Hyderabad, Telangana, India. Infrastructure Services at Alight
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
๐Lolly.com is Hiring !!
Role: Python Developer
Expected CTC: 6-15 LPA
Apply here: https://linkedin.com/jobs/view/3796395323/
Role: Python Developer
Expected CTC: 6-15 LPA
Apply here: https://linkedin.com/jobs/view/3796395323/
Linkedin
Lolly.com hiring Python Developer in Bengaluru, Karnataka, India | LinkedIn
Posted 2:30:47 PM. CTC 6-15 LPACompany DescriptionLolly.com is a unified Influencer Marketplace that powers brandsโฆSee this and similar jobs on LinkedIn.
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company - HITACHI
Role - R&D Engineer
Batch - 2023 , 2024
Exp CTC - 15 lpa
Location - Bengaluru
Link - https://www.hitachienergy.com/careers/open-jobs/details/JID3-60485
Role - R&D Engineer
Batch - 2023 , 2024
Exp CTC - 15 lpa
Location - Bengaluru
Link - https://www.hitachienergy.com/careers/open-jobs/details/JID3-60485
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
๐Medpace, Inc. is Hiring !!
Role: Software Engineer
Experience: Fresher
Apply here: https://careers.medpace.com/jobs/8753
Role: Software Engineer
Experience: Fresher
Apply here: https://careers.medpace.com/jobs/8753
Software/Research Engineer - Core Laboratory in Navi Mumbai, India | Medpace, Inc.
Medpace, Inc. is hiring a Software/Research Engineer - Core Laboratory in Navi Mumbai, India. Review all of the job details and apply today!
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
๐Postman is Hiring !!
Role: SDE Intern for 6 Months
Batch: 2024
Expected Stipend: 50k per month
Apply here- https://www.postman.com/company/careers/software-engineer-intern-5842012003/
Role: SDE Intern for 6 Months
Batch: 2024
Expected Stipend: 50k per month
Apply here- https://www.postman.com/company/careers/software-engineer-intern-5842012003/
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Airblack is hiring SDE Interns
For 2024/2023 Grads
Duration: 6 months
https://www.linkedin.com/posts/suyash-agrawal-25204a131_hiring-hiringdevelopers-fullstackdevelopment-activity-7150420023948234752-z3SE?utm_source=share&utm_medium=member_android
For 2024/2023 Grads
Duration: 6 months
https://www.linkedin.com/posts/suyash-agrawal-25204a131_hiring-hiringdevelopers-fullstackdevelopment-activity-7150420023948234752-z3SE?utm_source=share&utm_medium=member_android
Linkedin
Suyash Agrawal on LinkedIn: #hiring #hiringdevelopers #fullstackdevelopment #developercommunityโฆ | 133 comments
I am looking to hire full-stack development interns for a few projects. You will get to work on cool features using the latest technologies for a community ofโฆ | 133 comments on LinkedIn
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company - IntelliFill Tech Pvt Ltd
Role - Software Engineer Internship
Batch - 2023/2024/2025
Apply Link - https://unstop.com/o/o0V4HyK?lb=cdmoBrn&utm_medium=Share&utm_source=shortUrl
Role - Software Engineer Internship
Batch - 2023/2024/2025
Apply Link - https://unstop.com/o/o0V4HyK?lb=cdmoBrn&utm_medium=Share&utm_source=shortUrl
Unstop
Software Engineer Intern by IntelliFill Tech Pvt Ltd! | 2024 // Unstop
Software Engineer Intern a jobs by IntelliFill Tech Pvt Ltd open to All Apply online before 2024-01-19 20:00:00! | 2024
๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
Photo
vector<int> solve(vector<int>& mem, vector<vector<int>>& queries) {
map<int, pair<int, int>> alloc;
int id = 1;
vector<int> res;
for (auto& q : queries) {
if (q[0] == 0) {
int x = q[1];
int start = -1;
int count = 0;
for (int i = 0; i < mem.size(); ++i) {
if (mem[i] == 0) {
if (start == -1 && i % 8 == 0) {
start = i;
}
if (start != -1) {
++count;
}
if (count == x) {
break;
}
} else {
start = -1;
count = 0;
}
}
if (count == x) {
fill(mem.begin() + start, mem.begin() + start + x, 1);
alloc[start] = {id, x};
res.push_back(start);
++id;
} else {
res.push_back(-1);
}
} else {
int eraseId = q[1];
int length = -1;
for(auto it = alloc.begin(); it != alloc.end(); ++it) {
if(it->second.first == eraseId) {
fill(mem.begin() + it->first, mem.begin() + it->first + it->second.second, 0);
length = it->second.second;
alloc.erase(it);
break;
}
}
res.push_back(length);
}
}
return res;
}
Tradedsk โ
map<int, pair<int, int>> alloc;
int id = 1;
vector<int> res;
for (auto& q : queries) {
if (q[0] == 0) {
int x = q[1];
int start = -1;
int count = 0;
for (int i = 0; i < mem.size(); ++i) {
if (mem[i] == 0) {
if (start == -1 && i % 8 == 0) {
start = i;
}
if (start != -1) {
++count;
}
if (count == x) {
break;
}
} else {
start = -1;
count = 0;
}
}
if (count == x) {
fill(mem.begin() + start, mem.begin() + start + x, 1);
alloc[start] = {id, x};
res.push_back(start);
++id;
} else {
res.push_back(-1);
}
} else {
int eraseId = q[1];
int length = -1;
for(auto it = alloc.begin(); it != alloc.end(); ++it) {
if(it->second.first == eraseId) {
fill(mem.begin() + it->first, mem.begin() + it->first + it->second.second, 0);
length = it->second.second;
alloc.erase(it);
break;
}
}
res.push_back(length);
}
}
return res;
}
Tradedsk โ