#include <bits/stdc++.h>
using namespace std;
#define int long long
vector<pair<int,int>> v;
int dp[1005][1005];
int solve(int i,int alice,int bob){
if(i==v.size()) return 0;
if(dp[alice][bob]!=-1) return dp[alice][bob];
int v1=abs(v[alice].first-v[i].first) + abs(v[alice].second-v[i].second);
int v2=abs(v[bob].first-v[i].first) + abs(v[bob].second-v[i].second);
int al=v1 + solve(i+1,i,bob);
int bb=v2 + solve(i+1,alice,i);
return dp[alice][bob]=min(al,bb);
}
signed main() {
int n;
cin>>n;
v.resize(n+2);
memset(dp,-1,sizeof(dp));
for(int i=0;i<n+2;i++){
cin>>v[i].first>>v[i].second;
}
cout<<solve(2,0,1);
return 0;
}
Falling Apples โ
using namespace std;
#define int long long
vector<pair<int,int>> v;
int dp[1005][1005];
int solve(int i,int alice,int bob){
if(i==v.size()) return 0;
if(dp[alice][bob]!=-1) return dp[alice][bob];
int v1=abs(v[alice].first-v[i].first) + abs(v[alice].second-v[i].second);
int v2=abs(v[bob].first-v[i].first) + abs(v[bob].second-v[i].second);
int al=v1 + solve(i+1,i,bob);
int bb=v2 + solve(i+1,alice,i);
return dp[alice][bob]=min(al,bb);
}
signed main() {
int n;
cin>>n;
v.resize(n+2);
memset(dp,-1,sizeof(dp));
for(int i=0;i<n+2;i++){
cin>>v[i].first>>v[i].second;
}
cout<<solve(2,0,1);
return 0;
}
Falling Apples โ
๐1
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
If youโre interested, just go for it ๐ค
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company Name: Ford
Role: Software. Engineer
Batch eligible: 2022 and 2023 grads.
Apply: https://efds.fa.em5.oraclecloud.com/hcmUI/CandidateExperience/en/sites/CX_1/requisitions/preview/12657/
Note:
1) Below this hiring, you will find many other openings for the same role, do apply in which you are confident.
2) Try to go with referral.
Role: Software. Engineer
Batch eligible: 2022 and 2023 grads.
Apply: https://efds.fa.em5.oraclecloud.com/hcmUI/CandidateExperience/en/sites/CX_1/requisitions/preview/12657/
Note:
1) Below this hiring, you will find many other openings for the same role, do apply in which you are confident.
2) Try to go with referral.
Ford Global Career Site
2023 Software Engineer
int solve(vector<int> &a){
vector<int> xorr(128, -1);
xorr[0] = 0;
for(auto i: a){
for(int v=0; v<128; v++){
if(xorr[v]!=-1){
if(xorr[v]<i and builtin_popcount(v)<=builtin_popcount(i)){
int newx = v^i;
if(xorr[newx]==-1) xorr[newx] = i;
else xorr[newx] = min(i, xorr[newx]);
}
}
}
}
int cnt = 0;
for(auto i: xorr){
if(i!=-1) cnt++;
}
return cnt;
}
Media net xor subsequence โ
vector<int> xorr(128, -1);
xorr[0] = 0;
for(auto i: a){
for(int v=0; v<128; v++){
if(xorr[v]!=-1){
if(xorr[v]<i and builtin_popcount(v)<=builtin_popcount(i)){
int newx = v^i;
if(xorr[newx]==-1) xorr[newx] = i;
else xorr[newx] = min(i, xorr[newx]);
}
}
}
}
int cnt = 0;
for(auto i: xorr){
if(i!=-1) cnt++;
}
return cnt;
}
Media net xor subsequence โ
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company profile link:
https://www.linkedin.com/company/trialshoppy/
Intern openings in Trialshopy remote work.
Apply:https://docs.google.com/forms/d/15nYBTPKRxqPKv2oWWBP9FTlHF08D4CQ6fkfxAMLSjrc/edit
https://www.linkedin.com/company/trialshoppy/
Intern openings in Trialshopy remote work.
Apply:https://docs.google.com/forms/d/15nYBTPKRxqPKv2oWWBP9FTlHF08D4CQ6fkfxAMLSjrc/edit
Google Docs
Summer internship Offer at Trialshopy
Frontend Developer Internship at Trialshopy -6/ 2-Month Opportunity
As Frontend developer we require:
Proficiency in HTML, CSS, JavaScript, and frontend frameworks (React, Angular, or Vue.js). Strong problem-solving, collaboration, and attention to detailโฆ
As Frontend developer we require:
Proficiency in HTML, CSS, JavaScript, and frontend frameworks (React, Angular, or Vue.js). Strong problem-solving, collaboration, and attention to detailโฆ
๐1
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Costwise.Ai is hiring devops intern
Stipend : 10-20k
Link : https://docs.google.com/forms/d/e/1FAIpQLSdNiSqpEvNn5JM7zDYM7AwMWJYrfFzNvfBSeXGfveK8tsvfvQ/viewform
Stipend : 10-20k
Link : https://docs.google.com/forms/d/e/1FAIpQLSdNiSqpEvNn5JM7zDYM7AwMWJYrfFzNvfBSeXGfveK8tsvfvQ/viewform
Google Docs
DevOps Intern Application
Hiring for DevOps Intern at costwise.ai
Duration: 3-6 Months
Stipend: 10k-20k
Requirements (Mandatory) :
Hands-on Experience with Cloud ( AWS Preferred )
Strong DevOps Fundamentals (Linux, Networking, Docker etc.)
Automation with Shell Scripting / Pythonโฆ
Duration: 3-6 Months
Stipend: 10k-20k
Requirements (Mandatory) :
Hands-on Experience with Cloud ( AWS Preferred )
Strong DevOps Fundamentals (Linux, Networking, Docker etc.)
Automation with Shell Scripting / Pythonโฆ
๐1๐ฑ1
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
๐ด Company:- Boeing
Job Role :- ASSOCIATE SOFTWARE ENGINEER
Experienced Required : - 1 to 4 years
Eligibility : Bachelor or Master
Salary Range :- 9LPA to 30 LPA+ (Depend upon Experience)
Job Location - Bengaluru
โ๏ธ Apply Link : https://jobs.boeing.com/job/-/-/185/51425401296
Job Role :- ASSOCIATE SOFTWARE ENGINEER
Experienced Required : - 1 to 4 years
Eligibility : Bachelor or Master
Salary Range :- 9LPA to 30 LPA+ (Depend upon Experience)
Job Location - Bengaluru
โ๏ธ Apply Link : https://jobs.boeing.com/job/-/-/185/51425401296
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Walmart Converge Sparkathon
Chance to interview at Walmart for Software Engineering Internships and Full Time roles with a package of 23 LPA and a stipend of 1 Lakh/month.
Open to all engineering colleges in India who are pursuing the following degrees in circuit branches (ECE, EE, EEE, IT, CS):
BE/B.Tech - Batch of 2024 and 2025 (1st and 2nd-year students are not eligible to apply)
Dual degree full-time program - Batch of 2024 and 2025 (1st/2nd/3rd-year students are not eligible to apply)
ME/M.Tech. full-time programs - Batch of 2024 (1st-year students are not eligible to apply)
Apply Link: https://walmart.converge.tech/content/converge/en_in/sparkathon.html
Chance to interview at Walmart for Software Engineering Internships and Full Time roles with a package of 23 LPA and a stipend of 1 Lakh/month.
Open to all engineering colleges in India who are pursuing the following degrees in circuit branches (ECE, EE, EEE, IT, CS):
BE/B.Tech - Batch of 2024 and 2025 (1st and 2nd-year students are not eligible to apply)
Dual degree full-time program - Batch of 2024 and 2025 (1st/2nd/3rd-year students are not eligible to apply)
ME/M.Tech. full-time programs - Batch of 2024 (1st-year students are not eligible to apply)
Apply Link: https://walmart.converge.tech/content/converge/en_in/sparkathon.html
Sparkathon: Open innovation challenge for Indian students
Hack your way through complex retail problems using deep tech and build a culture that emphasizes product innovation and entrepreneurial vision.
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Xiaomi Technology Hiring !!
Role - Internship
Batch - 2024
Location - singapore
https://www.linkedin.com/jobs/view/3644157973
Role - Internship
Batch - 2024
Location - singapore
https://www.linkedin.com/jobs/view/3644157973
Linkedin
Xiaomi Technology hiring ใINTERNใSite Reliability Engineer in Singapore, Singapore | LinkedIn
Posted 9:47:40 AM. This position belongs to the 2024 Xiaomi Intern Recruitment Program.The ideal candidate'sโฆSee this and similar jobs on LinkedIn.
๐2
def countWays(k: int, n: int) -> int:
MOD = 10**9 + 7
dp = [[0 for _ in range(n + 1)] for __ in range(k + 1)]
dp[1] = [0] + [1] * n
for i in range(2, k + 1):
total = sum(dp[i - 1])
for j in range(1, n + 1):
dp[i][j] = (total - dp[i - 1][j]) % MOD
return sum(dp[k]) % MOD
DTCC | Python โ
MOD = 10**9 + 7
dp = [[0 for _ in range(n + 1)] for __ in range(k + 1)]
dp[1] = [0] + [1] * n
for i in range(2, k + 1):
total = sum(dp[i - 1])
for j in range(1, n + 1):
dp[i][j] = (total - dp[i - 1][j]) % MOD
return sum(dp[k]) % MOD
DTCC | Python โ
public class Solution {
public static int getMaxLength(List<Integer> list) {
int n = list.size();
int[] freq = new int[32];
for (int num : list) {
for (int bit = 0; bit < 32; bit++) {
if ((num & (1 << bit)) != 0) {
freq[bit]++;
}
}
}
int maxLen = 0;
for (int i = 0; i < 32; i++) {
maxLen = Math.max(maxLen, freq[i]);
}
return maxLen;
}
}
Hackerrank
subsequence Length โ
public static int getMaxLength(List<Integer> list) {
int n = list.size();
int[] freq = new int[32];
for (int num : list) {
for (int bit = 0; bit < 32; bit++) {
if ((num & (1 << bit)) != 0) {
freq[bit]++;
}
}
}
int maxLen = 0;
for (int i = 0; i < 32; i++) {
maxLen = Math.max(maxLen, freq[i]);
}
return maxLen;
}
}
Hackerrank
subsequence Length โ
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company Name: Hackerearth
Role: Problem Setter
Batch eligible: 2023 and 2024 grads
Apply: https://hackerearthjobs.hire.trakstar.com/jobs/fk0xtu1?pjb_hash=Y7bAmjMPq4
Role: Problem Setter
Batch eligible: 2023 and 2024 grads
Apply: https://hackerearthjobs.hire.trakstar.com/jobs/fk0xtu1?pjb_hash=Y7bAmjMPq4
#include<bits/stdc++.h>
using namespace std;
int F(int x){
int sum = 0;
while(x){
sum += x%10;
x /= 10;
}
return sum;
}
int main() {
int a, b, c;
cin >> a >> b >> c;
int max_x = max(b, c) * pow(9, a) + c;
int max_digits = floor(log10(max_x) + 1);
int max_Fx = 9 * max_digits;
vector<int> solutions;
for(int sum = 1; sum <= max_Fx; sum++){
int x = b * pow(sum, a) + c;
if(x <= max_x && sum == F(x)){
solutions.push_back(x);
}
}
cout << solutions.size() << endl;
for(int x : solutions){
cout << x << " ";
}
cout << endl;
return 0;
}
Jaguar โ
using namespace std;
int F(int x){
int sum = 0;
while(x){
sum += x%10;
x /= 10;
}
return sum;
}
int main() {
int a, b, c;
cin >> a >> b >> c;
int max_x = max(b, c) * pow(9, a) + c;
int max_digits = floor(log10(max_x) + 1);
int max_Fx = 9 * max_digits;
vector<int> solutions;
for(int sum = 1; sum <= max_Fx; sum++){
int x = b * pow(sum, a) + c;
if(x <= max_x && sum == F(x)){
solutions.push_back(x);
}
}
cout << solutions.size() << endl;
for(int x : solutions){
cout << x << " ";
}
cout << endl;
return 0;
}
Jaguar โ
๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
Photo
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll INF = 1e18;
int N;
vector<pair<ll,ll>> trees;
ll Manhattan(pair<ll,ll> a, pair<ll,ll> b) {
return abs(a.first - b.first) + abs(a.second - b.second);
}
ll findMinDistance() {
sort(trees.begin(), trees.end());
ll minDist = INF;
for(int i = 1; i < N; i++) {
minDist = min(minDist, Manhattan(trees[i], trees[i-1]));
}
return minDist;
}
ll findMaxDistance() {
ll mx1 = -INF, mx2 = -INF, mn1 = INF, mn2 = INF;
for(int i = 0; i < N; i++) {
mx1 = max(mx1, trees[i].first + trees[i].second);
mn1 = min(mn1, trees[i].first + trees[i].second);
mx2 = max(mx2, trees[i].first - trees[i].second);
mn2 = min(mn2, trees[i].first - trees[i].second);
}
return max(mx1 - mn1, mx2 - mn2);
}
void solve() {
ll minMaxDist = INF, maxMinDist = -INF;
for(int i = 0; i < N; i++) {
pair<ll,ll> temp = trees[i];
trees.erase(trees.begin() + i);
minMaxDist = min(minMaxDist, findMaxDistance());
maxMinDist = max(maxMinDist, findMinDistance());
trees.insert(trees.begin() + i, temp);
}
cout << minMaxDist << '\n';
cout << maxMinDist << '\n';
}
int main() {
cin >> N;
trees.resize(N);
for(int i = 0; i < N; i++) {
cin >> trees[i].first >> trees[i].second;
}
solve();
return 0;
}
Maximum and Minimum distance โ
using namespace std;
typedef long long ll;
const ll INF = 1e18;
int N;
vector<pair<ll,ll>> trees;
ll Manhattan(pair<ll,ll> a, pair<ll,ll> b) {
return abs(a.first - b.first) + abs(a.second - b.second);
}
ll findMinDistance() {
sort(trees.begin(), trees.end());
ll minDist = INF;
for(int i = 1; i < N; i++) {
minDist = min(minDist, Manhattan(trees[i], trees[i-1]));
}
return minDist;
}
ll findMaxDistance() {
ll mx1 = -INF, mx2 = -INF, mn1 = INF, mn2 = INF;
for(int i = 0; i < N; i++) {
mx1 = max(mx1, trees[i].first + trees[i].second);
mn1 = min(mn1, trees[i].first + trees[i].second);
mx2 = max(mx2, trees[i].first - trees[i].second);
mn2 = min(mn2, trees[i].first - trees[i].second);
}
return max(mx1 - mn1, mx2 - mn2);
}
void solve() {
ll minMaxDist = INF, maxMinDist = -INF;
for(int i = 0; i < N; i++) {
pair<ll,ll> temp = trees[i];
trees.erase(trees.begin() + i);
minMaxDist = min(minMaxDist, findMaxDistance());
maxMinDist = max(maxMinDist, findMinDistance());
trees.insert(trees.begin() + i, temp);
}
cout << minMaxDist << '\n';
cout << maxMinDist << '\n';
}
int main() {
cin >> N;
trees.resize(N);
for(int i = 0; i < N; i++) {
cin >> trees[i].first >> trees[i].second;
}
solve();
return 0;
}
Maximum and Minimum distance โ
๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
#include<bits/stdc++.h> using namespace std; int F(int x){ int sum = 0; while(x){ sum += x%10; x /= 10; } return sum; } int main() { int a, b, c; cin >> a >> b >> c; int max_x = max(b, c) * pow(9, a) + c; โฆ
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Linkedin
114,000+ Software Engineer jobs in India (3,962 new)
Todayโs top 114,000+ Software Engineer jobs in India. Leverage your professional network, and get hired. New Software Engineer jobs added daily.
#include<bits/stdc++.h>
using namespace std;
int countOccurrences(int num, int k) {
string numStr = to_string(num);
return count(numStr.begin(), numStr.end(), '0' + k);
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int k, n;
cin >> k;
cin >> n;
if(n == 0) {
cout << -1;
return 0;
}
vector<int> arr(n);
for(int i = 0; i < n; i++) {
cin >> arr[i];
}
int maxCount = -1;
int number = 0;
for(int i = 0; i < n; i++) {
int currentCount = countOccurrences(arr[i], k);
if(currentCount > maxCount) {
maxCount = currentCount;
number = arr[i];
}
}
if(maxCount == 0) {
cout << 0;
} else {
cout << number;
}
return 0;
}
C++โ
using namespace std;
int countOccurrences(int num, int k) {
string numStr = to_string(num);
return count(numStr.begin(), numStr.end(), '0' + k);
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int k, n;
cin >> k;
cin >> n;
if(n == 0) {
cout << -1;
return 0;
}
vector<int> arr(n);
for(int i = 0; i < n; i++) {
cin >> arr[i];
}
int maxCount = -1;
int number = 0;
for(int i = 0; i < n; i++) {
int currentCount = countOccurrences(arr[i], k);
if(currentCount > maxCount) {
maxCount = currentCount;
number = arr[i];
}
}
if(maxCount == 0) {
cout << 0;
} else {
cout << number;
}
return 0;
}
C++โ
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
TCS Mega Walk-in Drive
Location: Hyderabad
Qualification: BCom, B.A, BBA, BSc (all streams), BCA, BMS, BAF, BBI
Batch: 2021, 2022 and 2023 batch
Salary: 3.4 LPA (Expected)
Walkin Date: Hyderabad (5th Aug 23)
Drive Venue: TCS Deccan park, Plot No 1, Software Units Layout, Madhapur, Hyderabad, Telangana 500081
Timings: 9 AM to 11 AM
Location: Hyderabad
Qualification: BCom, B.A, BBA, BSc (all streams), BCA, BMS, BAF, BBI
Batch: 2021, 2022 and 2023 batch
Salary: 3.4 LPA (Expected)
Walkin Date: Hyderabad (5th Aug 23)
Drive Venue: TCS Deccan park, Plot No 1, Software Units Layout, Madhapur, Hyderabad, Telangana 500081
Timings: 9 AM to 11 AM