#include <bits/stdc++.h>
#define ll long long
#define db double
#define fi first
#define se second
#define pb push_back
#define ppb pop_back
#define mk make_pair
#define pll pair<ll,ll>
#define pii pair<int,int>
#define pil pair<int,long long>
#define all(a) a.begin(),a.end()
#define tm template<class dt>
using namespace std;
using vi = vector<int>;
using vl = vector<ll>;
using vb = vector<bool>;
using ull = unsigned long long;
const int MOD = 1e9 + 7;
const db eps = 1e-9;
const db pi = acos(-1.0);
const int iinf = INT_MAX;
const ll inf = LLONG_MAX;
const long double f_inf = FLT_MAX;
#define debug(x) cout << #x << " " << x << "\n";
#define tC(t) for(int ti=1;ti<=t;ti++)
tm dt max_t(const dt &a,const dt &b){return (a>b)?a:b;}
tm dt min_t(const dt &a,const dt &b){return (a>b)?b:a;}
tm void swapx(dt &a,dt &b){a ^= b;b ^= a;a ^= b;}
struct Query{long long w;int u,v,idx;};
const int mxn = 1e5 + 10;
const int mxk = 20;
vi adj[mxn];
int tin[mxn],subt[mxn],lvl[mxn];
int dp[mxn][mxk],idx;
bool cmp(const Query &a,const Query &b){
if(a.w==b.w)return a.idx==-1;
else return a.w < b.w;
}
void dfs(int u = 1,int p = -1,int l = 0){
dp[u][0] = p; tin[u] = idx++;
subt[u] = 1; lvl[u] = l;
for(int i=1;i<mxk;i++){
if(dp[u][i-1]==-1)break;
dp[u][i] = dp[dp[u][i-1]][i-1];
}
for(auto v: adj[u]){
if(v==p)continue;
dfs(v,u,l+1);
subt[u] += subt[v];
}
}
struct Segtree{
vl t,lazy;
Segtree(int N){
t.assign(4 * N + 10, 0);
lazy.assign(4 * N + 10, 0);
}
void Update(int v,int l,int r,int lb,int ub,ll x){
if(lazy[v]){
t[v] += (r - l + 1) * lazy[v];
if(l!=r){
lazy[2*v+1] += lazy[v];
lazy[2*v+2] += lazy[v];
}
lazy[v] = 0;
}
if(r<lbub<l ub<lb)return;
if(l>=lb && r<=ub){
t[v] += (r - l + 1) * x;
if(l!=r){
lazy[2*v+1] += x;
lazy[2*v+2] += x;
}
return;
}
int m = l + (r-l)/2;
Update(2*v+1,l,m,lb,ub,x);
Update(2*v+2,m+1,r,lb,ub,x);
t[v] = t[2*v+1] + t[2*v+2];
}
long long Query(int v,int l,int r,int index){
if(lazy[v]){
t[v] += (r - l + 1) * lazy[v];
if(l!=r){
lazy[2*v+1] += lazy[v];
lazy[2*v+2] += lazy[v];
}
lazy[v] = 0;
}
if(l==r)return t[v];
int m = l + (r-l)/2;
if(index <= m)return Query(2*v+1,l,m,index);
else return Query(2*v+2,m+1,r,index);
}
};
int LCA(int a,int b){
if(lvl[b] > lvl[a])swapx<int>(a,b);
int dif = lvl[a] - lvl[b];
for(int i=mxk-1;i>=0;i--){
if(dif & (1ll<<i))a = dp[a][i];
}
if(a==b)return a;
for(int i=mxk-1;i>=0;i--){
if(dp[a][i]!=dp[b][i]){
a = dp[a][i];
b = dp[b][i];
}
}
return dp[a][0];
}
void Solve(int ti){
int N;
cin >> N;
long long w;
int a,b;
vector<Query> Q;
for(int i=1;i<=N;i++){
cin >> w;
Q.pb({w,i,-1,-1});
}
for(int i=1;i<N;i++){
cin >> a >> b;
adj[a].pb(b);
adj[b].pb(a);
}
int q;
cin >> q;
for(int i=0;i<q;i++){
cin >> a >> b >> w;
Q.pb({w, a, b, i});
}
sort(all(Q),cmp);
dfs();
long long C[N+1],R[q];
memset(C, 0, sizeof(C));
Segtree st(N);
int M = Q.size();
for(int i=0;i<M;i++){
if(Q[i].idx==-1){
int u = Q[i].u; C[u] = Q[i].w;
st.Update(0,0,N-1,tin[u],tin[u]+subt[u]-1,C[u]);
}else{
int lca = LCA(Q[i].u,Q[i].v);
long long Sum = 0;
Sum += st.Query(0,0,N-1,tin[Q[i].u]);
Sum += st.Query(0,0,N-1,tin[Q[i].v]);
#define ll long long
#define db double
#define fi first
#define se second
#define pb push_back
#define ppb pop_back
#define mk make_pair
#define pll pair<ll,ll>
#define pii pair<int,int>
#define pil pair<int,long long>
#define all(a) a.begin(),a.end()
#define tm template<class dt>
using namespace std;
using vi = vector<int>;
using vl = vector<ll>;
using vb = vector<bool>;
using ull = unsigned long long;
const int MOD = 1e9 + 7;
const db eps = 1e-9;
const db pi = acos(-1.0);
const int iinf = INT_MAX;
const ll inf = LLONG_MAX;
const long double f_inf = FLT_MAX;
#define debug(x) cout << #x << " " << x << "\n";
#define tC(t) for(int ti=1;ti<=t;ti++)
tm dt max_t(const dt &a,const dt &b){return (a>b)?a:b;}
tm dt min_t(const dt &a,const dt &b){return (a>b)?b:a;}
tm void swapx(dt &a,dt &b){a ^= b;b ^= a;a ^= b;}
struct Query{long long w;int u,v,idx;};
const int mxn = 1e5 + 10;
const int mxk = 20;
vi adj[mxn];
int tin[mxn],subt[mxn],lvl[mxn];
int dp[mxn][mxk],idx;
bool cmp(const Query &a,const Query &b){
if(a.w==b.w)return a.idx==-1;
else return a.w < b.w;
}
void dfs(int u = 1,int p = -1,int l = 0){
dp[u][0] = p; tin[u] = idx++;
subt[u] = 1; lvl[u] = l;
for(int i=1;i<mxk;i++){
if(dp[u][i-1]==-1)break;
dp[u][i] = dp[dp[u][i-1]][i-1];
}
for(auto v: adj[u]){
if(v==p)continue;
dfs(v,u,l+1);
subt[u] += subt[v];
}
}
struct Segtree{
vl t,lazy;
Segtree(int N){
t.assign(4 * N + 10, 0);
lazy.assign(4 * N + 10, 0);
}
void Update(int v,int l,int r,int lb,int ub,ll x){
if(lazy[v]){
t[v] += (r - l + 1) * lazy[v];
if(l!=r){
lazy[2*v+1] += lazy[v];
lazy[2*v+2] += lazy[v];
}
lazy[v] = 0;
}
if(r<lb
if(l>=lb && r<=ub){
t[v] += (r - l + 1) * x;
if(l!=r){
lazy[2*v+1] += x;
lazy[2*v+2] += x;
}
return;
}
int m = l + (r-l)/2;
Update(2*v+1,l,m,lb,ub,x);
Update(2*v+2,m+1,r,lb,ub,x);
t[v] = t[2*v+1] + t[2*v+2];
}
long long Query(int v,int l,int r,int index){
if(lazy[v]){
t[v] += (r - l + 1) * lazy[v];
if(l!=r){
lazy[2*v+1] += lazy[v];
lazy[2*v+2] += lazy[v];
}
lazy[v] = 0;
}
if(l==r)return t[v];
int m = l + (r-l)/2;
if(index <= m)return Query(2*v+1,l,m,index);
else return Query(2*v+2,m+1,r,index);
}
};
int LCA(int a,int b){
if(lvl[b] > lvl[a])swapx<int>(a,b);
int dif = lvl[a] - lvl[b];
for(int i=mxk-1;i>=0;i--){
if(dif & (1ll<<i))a = dp[a][i];
}
if(a==b)return a;
for(int i=mxk-1;i>=0;i--){
if(dp[a][i]!=dp[b][i]){
a = dp[a][i];
b = dp[b][i];
}
}
return dp[a][0];
}
void Solve(int ti){
int N;
cin >> N;
long long w;
int a,b;
vector<Query> Q;
for(int i=1;i<=N;i++){
cin >> w;
Q.pb({w,i,-1,-1});
}
for(int i=1;i<N;i++){
cin >> a >> b;
adj[a].pb(b);
adj[b].pb(a);
}
int q;
cin >> q;
for(int i=0;i<q;i++){
cin >> a >> b >> w;
Q.pb({w, a, b, i});
}
sort(all(Q),cmp);
dfs();
long long C[N+1],R[q];
memset(C, 0, sizeof(C));
Segtree st(N);
int M = Q.size();
for(int i=0;i<M;i++){
if(Q[i].idx==-1){
int u = Q[i].u; C[u] = Q[i].w;
st.Update(0,0,N-1,tin[u],tin[u]+subt[u]-1,C[u]);
}else{
int lca = LCA(Q[i].u,Q[i].v);
long long Sum = 0;
Sum += st.Query(0,0,N-1,tin[Q[i].u]);
Sum += st.Query(0,0,N-1,tin[Q[i].v]);
๐3
Sum = Sum - 2 * 1ll * st.Query(0,0,N-1,tin[lca]);
Sum += C[lca];
R[Q[i].idx] = Sum;
}
}
for(auto r: R)cout << r << '\n';
}
int main(){
cin.tie(0)->sync_with_stdio(0);
memset(dp, -1, sizeof(dp));
memset(tin, -1, sizeof(tin));
memset(subt, 0, sizeof(subt));
idx = 0;
int t = 1;
tC(t){
Solve(ti);
}
return 0;
}
Sum of population โ
Sum += C[lca];
R[Q[i].idx] = Sum;
}
}
for(auto r: R)cout << r << '\n';
}
int main(){
cin.tie(0)->sync_with_stdio(0);
memset(dp, -1, sizeof(dp));
memset(tin, -1, sizeof(tin));
memset(subt, 0, sizeof(subt));
idx = 0;
int t = 1;
tC(t){
Solve(ti);
}
return 0;
}
Sum of population โ
๐1
๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
Sum = Sum - 2 * 1ll * st.Query(0,0,N-1,tin[lca]); Sum += C[lca]; R[Q[i].idx] = Sum; } } for(auto r: R)cout << r << '\n'; } int main(){ cin.tie(0)->sync_with_stdio(0); memset(dp, -1, sizeof(dp)); โฆ
Date - 30/12/2023
Company Name - Course i5
Role: Data Scientist
Q. How can outlier values be treated?
A. An outlier is an observation in a dataset that differs significantly from the rest of the data. This signifies that an outlier is much larger or smaller than the rest of the data.
Given are some of the methods of treating the outliers: Trimming or removing the outlier, Quantile based flooring and capping, Mean/Median imputation.
Q. What is root cause analysis?
A. A root cause is a component that contributed to a nonconformance and should be eradicated permanently through process improvement. The root cause is the most fundamental problemโthe most fundamental reasonโthat puts in motion the entire cause-and-effect chain that leads to the problem (s). Root cause analysis (RCA) is a word that refers to a variety of approaches, tools, and procedures used to identify the root causes of problems. Some RCA approaches are more directed toward uncovering actual root causes than others, while others are more general problem-solving procedures, and yet others just provide support for the root cause analysis core activity.
Q. What is bias and variance in Data Science?
A. The model's simplifying assumptions simplify the target function, making it easier to estimate. Bias is the difference between the Predicted Value and the Expected Value in its most basic form. Variance refers to how much the target function's estimate will fluctuate as a result of varied training data. In contrast to bias, variance occurs when the model takes into account the data's fluctuations, or noise.
Q. What is a confusion matrix?
A. A confusion matrix is a method of summarising a classification algorithm's performance. Calculating a confusion matrix can help you understand what your classification model is getting right and where it is going wrong. This gives us the following: "True positive" for event values that were successfully predicted. "False positive" for event values that were mistakenly predicted. For successfully anticipated no-event values, "true negative" is used. "False negative" for no-event values that were mistakenly predicted.
โโโโโโโโโโโโโโโโโโโโ-
Company Name - Course i5
Role: Data Scientist
Q. How can outlier values be treated?
A. An outlier is an observation in a dataset that differs significantly from the rest of the data. This signifies that an outlier is much larger or smaller than the rest of the data.
Given are some of the methods of treating the outliers: Trimming or removing the outlier, Quantile based flooring and capping, Mean/Median imputation.
Q. What is root cause analysis?
A. A root cause is a component that contributed to a nonconformance and should be eradicated permanently through process improvement. The root cause is the most fundamental problemโthe most fundamental reasonโthat puts in motion the entire cause-and-effect chain that leads to the problem (s). Root cause analysis (RCA) is a word that refers to a variety of approaches, tools, and procedures used to identify the root causes of problems. Some RCA approaches are more directed toward uncovering actual root causes than others, while others are more general problem-solving procedures, and yet others just provide support for the root cause analysis core activity.
Q. What is bias and variance in Data Science?
A. The model's simplifying assumptions simplify the target function, making it easier to estimate. Bias is the difference between the Predicted Value and the Expected Value in its most basic form. Variance refers to how much the target function's estimate will fluctuate as a result of varied training data. In contrast to bias, variance occurs when the model takes into account the data's fluctuations, or noise.
Q. What is a confusion matrix?
A. A confusion matrix is a method of summarising a classification algorithm's performance. Calculating a confusion matrix can help you understand what your classification model is getting right and where it is going wrong. This gives us the following: "True positive" for event values that were successfully predicted. "False positive" for event values that were mistakenly predicted. For successfully anticipated no-event values, "true negative" is used. "False negative" for no-event values that were mistakenly predicted.
โโโโโโโโโโโโโโโโโโโโ-
๐2
Happy New Year Everyone! ๐ฅณ
Thanks for believing us, I will try my best to provide every opportunities to you guys, and extremely sorry if I missed out any opportunities in 2023.
Sb milkr OffCampus Phodenge 2024 mei๐โค๏ธโค๏ธ
Thanks for believing us, I will try my best to provide every opportunities to you guys, and extremely sorry if I missed out any opportunities in 2023.
Sb milkr OffCampus Phodenge 2024 mei๐โค๏ธโค๏ธ
โค5๐2
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company Name: RSA
Role: Software Engineer - Apprentice
Batch eligible: 2022 and 2023 grads
Apply: https://jobs.rsa.com/job/-/-/31988/58592198928
Role: Software Engineer - Apprentice
Batch eligible: 2022 and 2023 grads
Apply: https://jobs.rsa.com/job/-/-/31988/58592198928
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company Name: Extreme Network
Role: Associate Software Engineer
Batch eligible: 2024 grads only
Apply: https://jobs.lever.co/extremenetworks/3cec1fc0-fe34-4359-a99d-958f96c6d804
Role: Associate Software Engineer
Batch eligible: 2024 grads only
Apply: https://jobs.lever.co/extremenetworks/3cec1fc0-fe34-4359-a99d-958f96c6d804
๐2๐1
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company Name: Harman
Role: Software Engineer Intern
Batch eligible: 2023 and 2024 passouts
Apply: https://jobs.harman.com/en_US/careers/JobDetail/Intern/18384
Role: Software Engineer Intern
Batch eligible: 2023 and 2024 passouts
Apply: https://jobs.harman.com/en_US/careers/JobDetail/Intern/18384
Harman
Careers Site
๐1
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Godrej Infotech Ltd is going to conduct a Recruitment Drive for B.Tech 2023 Freshers.
Drive Date- 4th Jan'2024
Location - Godrej Bhavan, Sec V, Saltlake, Kolkata
Position- Software Development Trainee
Criteria-
B.Tech 2023 Passout (CSE, IT & ECE)
No Year Gaps
70% Marks through out (10th, 12th, Diploma & Graduation)
I would request the Interested Candidates to share your CVs to below mail Id and contact the below given number.
Email- sankalan@godrej.com
Drive Date- 4th Jan'2024
Location - Godrej Bhavan, Sec V, Saltlake, Kolkata
Position- Software Development Trainee
Criteria-
B.Tech 2023 Passout (CSE, IT & ECE)
No Year Gaps
70% Marks through out (10th, 12th, Diploma & Graduation)
I would request the Interested Candidates to share your CVs to below mail Id and contact the below given number.
Email- sankalan@godrej.com
๐1
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
๐CFT Lab is Hiring !!
Role: SDE - Frontend (Remote)
Experience: 0-3 years
Expected CTC: 5-7 LPA
Apply here: https://cftlab.in/career/64dca08f76920a5f4099e64f
Role: SDE - Frontend (Remote)
Experience: 0-3 years
Expected CTC: 5-7 LPA
Apply here: https://cftlab.in/career/64dca08f76920a5f4099e64f
๐1
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
๐Reddit is Hiring !!
Role: Software Engineering Intern (2024)
Stipend: $50 - $60 Hourly
Location: Remote
Apply here: https://app.ripplematch.com/v2/public/job/c7d28bdf/details?tl=a082f29d&fromPage=tracking_link
Role: Software Engineering Intern (2024)
Stipend: $50 - $60 Hourly
Location: Remote
Apply here: https://app.ripplematch.com/v2/public/job/c7d28bdf/details?tl=a082f29d&fromPage=tracking_link
RippleMatch
Apply for a Software Engineering Intern (2024) role at Reddit via RippleMatch
RippleMatch matches students and recent graduates with full time jobs and internships at companies around the world. Sign up for free in less than 5 minutes to find your dream job.
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company Name: Vestas
Role: Graduate Program Engineer
Batch eligible: 2023 and 2024 passouts
Apply: https://careers.vestas.com/job/Chennai-Engineering,-R&D-&-Innovation-Vestas-Graduate-Programme-TN/1011948301/
Role: Graduate Program Engineer
Batch eligible: 2023 and 2024 passouts
Apply: https://careers.vestas.com/job/Chennai-Engineering,-R&D-&-Innovation-Vestas-Graduate-Programme-TN/1011948301/
Vestas
Engineering, R&D & Innovation - Vestas Graduate Programme
Were you able to solve Random Flip Matrix question today? #6Companies30Days Challenge
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company Name: Brainvire Infotech
Role: Software Development Intern
Batch eligible: 2024 passouts only
Apply: https://docs.google.com/forms/d/e/1FAIpQLSfHr30yVJSOeG-Cy6Gs2vA3cmhTXrVbdeRDhhjAJAYaIQKwwg/viewform
Role: Software Development Intern
Batch eligible: 2024 passouts only
Apply: https://docs.google.com/forms/d/e/1FAIpQLSfHr30yVJSOeG-Cy6Gs2vA3cmhTXrVbdeRDhhjAJAYaIQKwwg/viewform
๐1
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company: Goldman Sachs
Role: Summer Analyst
Expected CTC: NA
Batch Eligible: 2024, 2025
Website: https://www.goldmansachs.com/careers/students/programs/india/summer-analyst-program.html
Role: Summer Analyst
Expected CTC: NA
Batch Eligible: 2024, 2025
Website: https://www.goldmansachs.com/careers/students/programs/india/summer-analyst-program.html
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
๐Labcorp is Hiring !!
Role: UI Software Engineer
Expected CTC: 8-14 LPA
Apply here: https://careers.labcorp.com/global/en/job/COVAGLOBAL2361951EXTERNALENGLOBAL/UI-Software-Engineer
Role: UI Software Engineer
Expected CTC: 8-14 LPA
Apply here: https://careers.labcorp.com/global/en/job/COVAGLOBAL2361951EXTERNALENGLOBAL/UI-Software-Engineer