Coding Games and Programming Challenges to Code Better
Send your feedback or ask for help here!
Created by @java_coffee_cup,validated by @Westicles,@FredericLocquet and @cg123.
If you have any issues, feel free to ping them.
Coding Games and Programming Challenges to Code Better
Send your feedback or ask for help here!
Created by @java_coffee_cup,validated by @Westicles,@FredericLocquet and @cg123.
If you have any issues, feel free to ping them.
Hey everyone
I think the problem is a fun exercise and itâ€™s great itâ€™s here.
However does it really need to be gendered in this way?
We all know that in the tech industry we struggle to attract diverse people and codingame is the first contact with development for a lot of people. So I think itâ€™s too bad that an exercise on this website conveys genders stereotypes like â€śgirls donâ€™t want boys to know their weightâ€ť.
I think it should be pretty straightforward to reword it lightly to make it a group of people or to find another story explaining why an observer would only have access to the grouped measurements.
Iâ€™m not sure whatâ€™s the process to do this kind of change but if I can be helpful Iâ€™m up to give a hand rewording the exercise
This puzzle would be more appropriate on a math forum
Great little brain-teaser. Another excellent production from java_coffee_cup.
This doesnâ€™t need loops. Just some basic calculations.
Find s = sum of total weights to 5 girls by calculating sum of pairs of weights divide by 4.
Calculate the middle girl by subtracting s to the first pair and the last pair.
Focus on the first two sums and the last two sums and the weight of the middle girl.
Sum of weights of 5 girls and the middle girl:
w = []
for i in input().split(): w.append(int(i))
c = sum(w)//4 - w[0] - w[-1]
Hello everyone,
I think this exercise is missing some informations about the order the people are paired up.
indeed their is not only one possible ordering.
For instance, I would assume that for people A, B, C, D, E , the order would be:
AB AC AD AE BC BD BE CD CE DE
The order isnâ€™t needed to be known (and if you did know it it would be a much easier problem to solve).
some hints to solve this puzzle :
Let say we have 5 girls with weights ( A,B,C,D and E) Where : A <= B <= C <= D < E
so :
min = A+B is the minimum pairwise weight
max = D+E is the maximum pairwise weight
A+B < A+C < â€¦ < C+E < D+E
the sum of all 10 pairwise weight measurements :
sum = (A+B) + (A+C) + (A+D) + (A+E) + (B+C) + (B+D) + (B+E) + (C+D) + (C+E) + (D+E)
= 4 * A + 4 * B + 4 * C + 4 * D + 4 * E
= 4 * (A + B + C + D + E)
Therefore :
you can calculte the weight C :
you can solve the rest by yourself
thanks to @khanglovesIT for the hints
Actually you used loop for summing up values into w array.
Well, algebra is a longtime forgotten memory for me. I went into a full equation solver starting from the weights. However, my paper solution did not cover all the possibilities
I should have checked this forum earlier, for this simple 4abcd*e solution. Another â€śstrive for simplicityâ€ť problem. Thanks, great exercice.