COGNIZANT EXAM HELP GROUP
3.55K subscribers
5.3K photos
21 videos
10 files
3.22K links
🚀 Placement Preparation Hub

🎓 From Preparation to Placement

OA Support • Coding • Aptitude • Technical • HR

🌟 Trusted by Hundreds of Students

🏆 372+ Placement Successes

📩 DM: @Mrtrueliving_ix

💙 Turning Aspirations into Offer Letters.
Download Telegram
import sys
from collections import defaultdict

def calculateAns(N, M, parents, latency, q, queries):
tree = defaultdict(list)
for i in range(M):
tree[parents[i]].append(i + 2)

power = [0] * (N + 1)
for i in range(1, N + 1):
if i == 1:
power[i] = float('inf')
else:
parent = parents[i - 2]
power[i] = latency[i - 1] ^ latency[parent - 1]

subtree_power = [0] * (N + 1)

def dfs(node):
total_power = power[node]
for child in tree[node]:
total_power = min(total_power, dfs(child))
subtree_power[node] = total_power
return total_power

dfs(1)

result = 0
for query in queries:
result = (result + subtree_power[query]) % (10**9 + 7)

return result

def main():
N = int(sys.stdin.readline().strip())
M = int(sys.stdin.readline().strip())
parents = []
for _ in range(M):
parents.append(int(sys.stdin.readline().strip()))
latency = []
for _ in range(N):
latency.append(int(sys.stdin.readline().strip()))
q = int(sys.stdin.readline().strip())
queries = []
for _ in range(q):
queries.append(int(sys.stdin.readline().strip()))
result = calculateAns(N, M, parents, latency, q, queries)
print(result)

if __name__ == "__main__":
main()

powerfull sys// infosys
Wipro Elite

{12.00 pm } // slot 2

All MCQs & coding & eassy are done

DM
@mrtrueliving_ix 💯

All placement help available
wipro 3 pm & 6pm slots available @mrteueliving_ix
  N = int(input().strip())  
s = input().strip()
print(-1 if s is None else len(set(s)))
cnt unique string// Wipro
 A, B = map(int, input().strip().split())
print((A // B) ** 3)
cube//wipro
Wipro Elite
{ 3 pm } // slot 3

All sections are done 💯

All placement help available

DM
@mrtrueliving_ix
WIPRO Elite

All MCQs along with Coding & essay writing done 💯

All placement help available


ON \\ OFF campus

DM for help

@mrtrueliving_ix 💯

@mryrueliving_ix 😄
All placement help available

On // Off campus placement 💯

DM
@mrtrueliving_ix💯

Test Clearance ❤️
Accenture on campus placement help available

DM @mrtrueliving_ix 💯
Accenture on campus Help done


access from college sys

Round 1 clear 💯

DM for any placement Help

@mrtrueliving_ix💯

Batch : 2025
Please open Telegram to view this post
VIEW IN TELEGRAM