subject

Problema #1651 GRAF de pe Pbinfo Cerința
Se dă lista muchiilor unui graf neorientat ponderat. Să se determine vârful pentru care media aritmetică a ponderilor muchiilor incidente este minimă. Dacă există mai multe vârfuri cu aceeași medie minimă, se va afișa vârful numerotat cu o valoare mai mică.

Date de intrare
Programul citește de la tastatură numerele n m, reprezentând numărul de vârfuri și numărul de muchii din graf, apoi m triplete i j p, reprezentând muchiile, date prin extremități și pondere.

Date de ieșire
Programul va afișa pe ecran numărul vf, reprezentând vârful determinat.

Restricții și precizări
1 ≤ n ≤ 100
ponderile muchiilor sunt numere naturale nenule mai mici decât 1000
Exemplu
Intrare

5 6
1 2 10
2 3 2
2 5 2
3 5 12
3 4 1
4 5 5
Ieșire

4
Explicație
Mediile ponderilor muchiilor incidente cu vârfurile grafului sunt:

pentru vârful 1 media este 10
pentru vârful 2 media este 4.66667
pentru vârful 3 media este 5
pentru vârful 4 media este 3
pentru vârful 5 media este 6.33333
Astfel media minimă este 3, pentru vârful 4

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 11:30
Hassan is writing his master’s thesis, which is a thirty-page document. he received some feedback from his professor in the form of comments, but does not see where the comments are. what is the fastest way for hassan to find the feedback?
Answers: 3
question
Computers and Technology, 22.06.2019 19:30
When using a public computer or network, you should always
Answers: 2
question
Computers and Technology, 23.06.2019 09:30
Facial expressions and gestures are examples of messages.
Answers: 3
question
Computers and Technology, 23.06.2019 19:40
Use a physical stopwatch to record the length of time it takes to run the program. calculate the difference obtained by calls to the method system.currenttimemillis() just before the start of the algorithm and just after the end of the algorithm. calculate the difference obtained by calls to the method system.currenttimemillis() at the start of the program and at the end of the program so that the elapsed time includes the display of the result. use the value returned by the method system.currenttimemillis() just after the end of the algorithm as the elapsed time.
Answers: 3
You know the right answer?
Problema #1651 GRAF de pe Pbinfo Cerința
Se dă lista muchiilor unui graf neorientat ponderat....
Questions
question
Mathematics, 26.03.2021 08:40
question
Social Studies, 26.03.2021 08:40
question
Biology, 26.03.2021 08:40
question
World Languages, 26.03.2021 08:40
Questions on the website: 13722359