๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
Photo
import sys
import threading
import bisect
def main():
import sys
sys.setrecursionlimit(1 << 25)
T = int(sys.stdin.readline())
for _ in range(T):
N, M = map(int, sys.stdin.readline().split())
children = [[] for _ in range(N + 1)]
C = [0] * (N + 1)
L = [0] * (N + 1)
for i in range(1, N + 1):
line = sys.stdin.readline()
if not line.strip():
line = sys.stdin.readline()
tokens = line.strip().split()
if len(tokens) !=3:
RM, cost, leadership = 0, 0, 0
else:
RM, cost, leadership = map(int, tokens)
if i ==1:
if RM ==1:
parent =0
else:
parent = RM
else:
parent = RM
children[parent].append(i)
C[i] = cost
L[i] = leadership
max_happiness = 0
def dfs(node):
nonlocal max_happiness
current_costs = [C[node]]
current_costs.sort()
for child in children[node]:
child_costs = dfs(child)
if len(child_costs) > len(current_costs):
current_costs, child_costs = child_costs, current_costs
merged = []
i = j =0
while i < len(current_costs) and j < len(child_costs):
if current_costs[i] < child_costs[j]:
merged.append(current_costs[i])
i +=1
else:
merged.append(child_costs[j])
j +=1
while i < len(current_costs):
merged.append(current_costs[i])
i +=1
while j < len(child_costs):
merged.append(child_costs[j])
j +=1
current_costs = merged
prefix_sums = [0]
for cost in current_costs:
prefix_sums.append(prefix_sums[-1] + cost)
k = bisect.bisect_right(prefix_sums, M) -1
happiness = L[node] * k
if happiness > max_happiness:
max_happiness = happiness
return current_costs
dfs(0)
print(max_happiness)
threading.Thread(target=main).start()
Human Resources
Rubrik โ
๐1๐ข1
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Send Resume
HR@VIDYAGXP.COM
HR@VIDYAGXP.COM
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Contact Number - 9121857799
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Disperz is hiring Associate Software Engineer
For 2024, 2025 grads
Location: Chennai
https://disprz.keka.com/careers/jobdetails/68865?source=linkedin
For 2024, 2025 grads
Location: Chennai
https://disprz.keka.com/careers/jobdetails/68865?source=linkedin
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
๐Synergy Solutions is hiring for Intern - Software Development [Fresher]
Experience: 0 - 1 year's
Expected Stipend: competitive
Apply here:https://synergysolutions.asia/careers/
Experience: 0 - 1 year's
Expected Stipend: competitive
Apply here:https://synergysolutions.asia/careers/
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
๐1
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Check out this job at InnovateGemini: https://www.linkedin.com/jobs/view/4046963846
#include <iostream>
#include <vector>
#include <string>
using namespace std;
int solve(string s) {
if (s.empty() || s[0] == '0') {
return 0;
}
int n = s.size();
vector<int> dp(n + 1, 0);
dp[0] = 1;
dp[1] = 1;
for (int i = 2; i <= n; ++i) {
if (s[i - 1] >= '1' && s[i - 1] <= '9') {
dp[i] += dp[i - 1];
}
int t = stoi(s.substr(i - 2, 2));
if (t >= 10 && t <= 26) {
dp[i] += dp[i - 2];
}
}
return dp[n];
}
int main() {
string s;
cin >> s;
int result = solve(s);
cout << result << endl;
return 0;
}
Decipher the numbersโ
Dream11
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
๐1
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Nuvama are hiring for AI ML role
Experience Range - Freshers - 2 Years of expertise!!
Location - BKC
Freshers willing to kickstart their career in AI ML role are welcome!!!!
Mail CV to - vidhi.thakkar@nuvama.com
Experience Range - Freshers - 2 Years of expertise!!
Location - BKC
Freshers willing to kickstart their career in AI ML role are welcome!!!!
Mail CV to - vidhi.thakkar@nuvama.com
๐1
import re
a = ["Inc.", "Corp.", "LLC", "L.L.C.", "LLC."]
b = ["the", "an", "a", "and"]
def normalize_name(c):
c = c.lower()
for d in a:
if c.endswith(d.lower()):
c = c[:-len(d)].strip()
c = re.sub(r'[&,]', ' ', c)
c = re.sub(r'\s+', ' ', c)
d = c.split()
if d[0] in b:
d = d[1:]
c = ' '.join(d)
return c.strip()
def check_availability(d):
e = set()
for f in d:
g, c = f.split('|')
h = normalize_name(c)
if not h:
print(f"{g}|Name Not Available")
elif h in e:
print(f"{g}|Name Not Available")
else:
e.add(h)
print(f"{g}|Name Available")
Stripe โ
๐1๐คฎ1
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
https://docs.google.com/forms/d/e/1FAIpQLSe-QUx66Fwb1eAtTskuh6Cf-GDNUrPn5cZxt7NWwIw-PkxiIA/viewform
JD: https://fluttering-dry-458.notion.site/Openings-at-Multibagg-Remote-111b5a5ac6028081a508efc31414084a
JD: https://fluttering-dry-458.notion.site/Openings-at-Multibagg-Remote-111b5a5ac6028081a508efc31414084a
Google Docs
Backend Developer @ Multibagg
Weโre building an AI-powered global equity research platform that will make fundamental investing easy, rewarding, and fun for everyone. Itโs a product from India, but made for the world, aimed at giving people access to high quality financial insights.
Weโreโฆ
Weโreโฆ
๐1
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Linkedin
Apeksha Rawat on LinkedIn: Hi Everyone,
EXL is organizing a Walkin drive at sector 144, Noida, onโฆ | 110 comments
EXL is organizing a Walkin drive at sector 144, Noida, onโฆ | 110 comments
Hi Everyone,
EXL is organizing a Walkin drive at sector 144, Noida, on 15th Oct'2024 for Back-office role.
Eligibility criteria-
โขExperience required:โฆ | 110 comments on LinkedIn
EXL is organizing a Walkin drive at sector 144, Noida, on 15th Oct'2024 for Back-office role.
Eligibility criteria-
โขExperience required:โฆ | 110 comments on LinkedIn
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Linkedin
Trisha Sahoo on LinkedIn: Greetings from WIPRO! ๐
๐ Exciting opportunity for Freshers to join ourโฆ
๐ Exciting opportunity for Freshers to join ourโฆ
Greetings from WIPRO! ๐
๐ Exciting opportunity for Freshers to join our team in Hyderabad for a Mapping role! ๐บ๏ธ
๐ Walk-in interview dates: 14th to 16thโฆ
๐ Exciting opportunity for Freshers to join our team in Hyderabad for a Mapping role! ๐บ๏ธ
๐ Walk-in interview dates: 14th to 16thโฆ