TaskOnce upon a time, there were N medieval towns in the beautiful Mol dịch - TaskOnce upon a time, there were N medieval towns in the beautiful Mol Việt làm thế nào để nói

TaskOnce upon a time, there were N

Task
Once upon a time, there were N medieval towns in the beautiful Moldavian territory, uniquely
numbered from 1 through N. The town numbered with 1 was the capital city. The towns were
connected by N-1 bidirectional roads, each road having a length expressed in kilometers. There
was a unique way to travel between any pair of towns without going through a town twice (i.e.
the graph of roads was a tree).
When a town was attacked, the situation had to be reported as soon as possible to the capital.
The message was carried by harbingers, one of which resided in each town. Each harbinger was
characterized by the amount of time required to start the journey and by his constant speed
(expressed in minutes per kilometer) after departure.

The message from a town was always carried on the unique shortest path to the capital. Initially,
the harbinger from the attacked town carried the message. In each town that he traversed, a
harbinger had two options: either go to the next town towards the capital, or leave the message
to the harbinger from this town. The new harbinger applied the same algorithm as above.
Overall, a message could be carried by any number of harbingers before arriving in the capital.

Your task is to find, for each town, the minimum time required to send a message from that
town to the capital.
Description of input
The first line of the input file harbingers.in contains one integer N, the number of towns in
Moldavia. Each of the following N-1 lines contains three integers u v d, separated by one
space, describing a road of length d kilometers between towns numbered with u and v.
Subsequently, N-1 pairs of integers follow, one per line. The i
th pair, Si Vi, describes the
characteristics of the harbinger in the (i+1)
th town: Si is the number of minutes to prepare for
the journey, and Vi is the number of minutes needed to travel one kilometer. There is no
harbinger in the capital.
0/5000
Từ: -
Sang: -
Kết quả (Việt) 1: [Sao chép]
Sao chép!
TaskOnce upon a time, there were N medieval towns in the beautiful Moldavian territory, uniquelynumbered from 1 through N. The town numbered with 1 was the capital city. The towns wereconnected by N-1 bidirectional roads, each road having a length expressed in kilometers. Therewas a unique way to travel between any pair of towns without going through a town twice (i.e.the graph of roads was a tree).When a town was attacked, the situation had to be reported as soon as possible to the capital.The message was carried by harbingers, one of which resided in each town. Each harbinger wascharacterized by the amount of time required to start the journey and by his constant speed(expressed in minutes per kilometer) after departure.The message from a town was always carried on the unique shortest path to the capital. Initially,the harbinger from the attacked town carried the message. In each town that he traversed, aharbinger had two options: either go to the next town towards the capital, or leave the messageto the harbinger from this town. The new harbinger applied the same algorithm as above.Overall, a message could be carried by any number of harbingers before arriving in the capital.Your task is to find, for each town, the minimum time required to send a message from thattown to the capital.Description of inputThe first line of the input file harbingers.in contains one integer N, the number of towns inMoldavia. Each of the following N-1 lines contains three integers u v d, separated by onespace, describing a road of length d kilometers between towns numbered with u and v.Subsequently, N-1 pairs of integers follow, one per line. The ith pair, Si Vi, describes thecharacteristics of the harbinger in the (i+1)th town: Si is the number of minutes to prepare forthe journey, and Vi is the number of minutes needed to travel one kilometer. There is noharbinger in the capital.
đang được dịch, vui lòng đợi..
Kết quả (Việt) 2:[Sao chép]
Sao chép!
Nhiệm vụ
xửa ngày xưa, có N thị trấn thời trung cổ ở lãnh thổ Moldavia đẹp, độc đáo
đánh số từ 1 đến N. Các thị trấn với số 1 là thành phố thủ đô. Các thị trấn được
kết nối bởi N-1 đường nối hai chiều, mỗi đường có chiều dài bày tỏ bằng km. Có
một cách duy nhất để đi lại giữa bất kỳ cặp thị trấn mà không qua một thị trấn hai lần (tức là
đồ thị của đường được một cây).
Khi một thị trấn đã bị tấn công, tình hình đã được báo cáo trong thời gian sớm nhất có thể đến thủ đô.
Các nhắn đã được tiến hành bởi báo hiệu, một trong số đó sống tại mỗi thành phố. Mỗi báo hiệu đã được
đặc trưng bởi số lượng thời gian cần thiết để bắt đầu cuộc hành trình và tốc độ liên tục của mình
(thể hiện ở phút mỗi km) sau khi khởi hành. Các tin nhắn từ một thị trấn luôn mang trên con đường ngắn nhất độc đáo về thủ đô. Ban đầu, các dấu hiệu từ thị trấn bị tấn công thực sự tin. Trong mỗi thị trấn mà ông đi qua, một dấu hiệu báo trước có hai lựa chọn: hoặc là đi đến thị trấn tiếp theo đối với vốn, hoặc để lại tin nhắn để báo hiệu từ thị trấn này. Các dấu hiệu mới áp dụng các thuật toán tương tự như trên. Nói chung, một tin nhắn có thể được thực hiện bởi bất kỳ số lượng báo hiệu trước khi đến thủ đô. Nhiệm vụ của bạn là để tìm kiếm, cho từng thị trấn, thời gian tối thiểu cần thiết để gửi một tin nhắn từ đó thị trấn để thủ đô. Mô tả các đầu vào Dòng đầu tiên của harbingers.in tập tin đầu vào có chứa một số nguyên N, số lượng các thị trấn ở Moldavia. Mỗi phòng trong số N-1 dòng tiếp theo chứa ba số nguyên UVD, ngăn cách bởi một không gian, mô tả một con đường có chiều dài d km giữa thị xã với số u và v. Sau đó, N-1 cặp số nguyên theo, mỗi dòng. Các i th cặp, Si Vi, mô tả các đặc điểm của báo hiệu trong (i + 1) lần thứ thị trấn: Si là số phút để chuẩn bị cho cuộc hành trình, và Vi là số phút cần thiết để đi du lịch một cây số. Không có dấu hiệu báo ở thủ đô.


















đang được dịch, vui lòng đợi..
 
Các ngôn ngữ khác
Hỗ trợ công cụ dịch thuật: Albania, Amharic, Anh, Armenia, Azerbaijan, Ba Lan, Ba Tư, Bantu, Basque, Belarus, Bengal, Bosnia, Bulgaria, Bồ Đào Nha, Catalan, Cebuano, Chichewa, Corsi, Creole (Haiti), Croatia, Do Thái, Estonia, Filipino, Frisia, Gael Scotland, Galicia, George, Gujarat, Hausa, Hawaii, Hindi, Hmong, Hungary, Hy Lạp, Hà Lan, Hà Lan (Nam Phi), Hàn, Iceland, Igbo, Ireland, Java, Kannada, Kazakh, Khmer, Kinyarwanda, Klingon, Kurd, Kyrgyz, Latinh, Latvia, Litva, Luxembourg, Lào, Macedonia, Malagasy, Malayalam, Malta, Maori, Marathi, Myanmar, Mã Lai, Mông Cổ, Na Uy, Nepal, Nga, Nhật, Odia (Oriya), Pashto, Pháp, Phát hiện ngôn ngữ, Phần Lan, Punjab, Quốc tế ngữ, Rumani, Samoa, Serbia, Sesotho, Shona, Sindhi, Sinhala, Slovak, Slovenia, Somali, Sunda, Swahili, Séc, Tajik, Tamil, Tatar, Telugu, Thái, Thổ Nhĩ Kỳ, Thụy Điển, Tiếng Indonesia, Tiếng Ý, Trung, Trung (Phồn thể), Turkmen, Tây Ban Nha, Ukraina, Urdu, Uyghur, Uzbek, Việt, Xứ Wales, Yiddish, Yoruba, Zulu, Đan Mạch, Đức, Ả Rập, dịch ngôn ngữ.

Copyright ©2025 I Love Translation. All reserved.

E-mail: