Billy Jean loves collecting frogs. Recently, she developed the sport o dịch - Billy Jean loves collecting frogs. Recently, she developed the sport o Việt làm thế nào để nói

Billy Jean loves collecting frogs.

Billy Jean loves collecting frogs. Recently, she developed the sport of frog wrestling. Now she wants to rank her frogs by their wrestling prowess.

Billy Jean has made a algorithm for sorting her frogs.

She arranges N cages, numbered 1,2,...N, each with one frog.
For each pair of cages in a specified, pre-determined list of K pairs of cages,
she removes the frogs from the two cages,
has the frogs wrestle,
puts the winner in the higher-numbered cage, and
puts the loser in the lower-numbered cage.

When she is finished, she hopes to have all her frogs sorted from worst to best in the cages 1 to N. Will her algorithm work regardless of the initial order of the frogs?

Note:

Assume that a strict ordering by wrestling ability is possible.
Billy Jean isn't the sharpest tool in the shed. Sometimes she has written the same two numbers for a pair. In this case, that frog is simply taken out and then put back.

Constraints

1
0/5000
Từ: -
Sang: -
Kết quả (Việt) 1: [Sao chép]
Sao chép!
Billy Jean loves collecting frogs. Recently, she developed the sport of frog wrestling. Now she wants to rank her frogs by their wrestling prowess.Billy Jean has made a algorithm for sorting her frogs. She arranges N cages, numbered 1,2,...N, each with one frog. For each pair of cages in a specified, pre-determined list of K pairs of cages, she removes the frogs from the two cages, has the frogs wrestle, puts the winner in the higher-numbered cage, and puts the loser in the lower-numbered cage.When she is finished, she hopes to have all her frogs sorted from worst to best in the cages 1 to N. Will her algorithm work regardless of the initial order of the frogs?Note: Assume that a strict ordering by wrestling ability is possible. Billy Jean isn't the sharpest tool in the shed. Sometimes she has written the same two numbers for a pair. In this case, that frog is simply taken out and then put back.Constraints1<=N<=201<=K<=1000InputThe first line is the number of test cases. Each test cases is preceded by a blank line.The first line of each test case is N. The next line is K. The next K lines are the pairs, separated by a single space.OutputOn separate lines, output whether Billy Jean's algorithm is correct. Output "YES" (without quotes) if it is or "NO" (without quotes) if it is not.
đang được dịch, vui lòng đợi..
Kết quả (Việt) 2:[Sao chép]
Sao chép!
Billy Jean rất thích thu thập những con ếch. Gần đây, bà đã phát triển môn thể thao của ếch đấu vật. Bây giờ cô ấy muốn để xếp hạng ếch của mình bằng sức mạnh vật của họ. Billy Jean đã thực hiện một thuật toán để phân loại ếch của cô. Cô sắp xếp N lồng, đánh số 1,2, ... N, mỗi một con ếch. Với mỗi cặp lồng trong một quy định, danh sách được xác định trước của cặp K lồng, cô bỏ các loài ếch từ hai lồng, có những con ếch vật lộn, đặt người chiến thắng trong lồng cao số, và đặt những kẻ thua cuộc trong lồng thấp hơn số. Khi cô ấy xong, cô hy vọng sẽ có tất cả những con ếch của cô được sắp xếp từ xấu nhất đến tốt nhất trong các lồng 1 đến N. Sẽ làm việc thuật toán của mình bất kể thứ tự ban đầu của những con ếch? Lưu ý: Giả sử rằng một trật tự nghiêm ngặt bởi khả năng đấu vật là có thể. Billy Jean isn 't các công cụ sắc bén trong nhà kho. Đôi khi cô ấy đã viết hai con số tương tự cho một cặp. Trong trường hợp này, ếch mà chỉ đơn giản là đưa ra và sau đó đưa trở lại. Ràng buộc 1 <= N <= 20 1 <= K <= 1000 Input Dòng đầu tiên là số lượng các trường hợp thử nghiệm. Mỗi trường hợp thử nghiệm là trước bởi một dòng trống. Dòng đầu tiên của mỗi test là N. Các dòng tiếp theo là K. K dòng tiếp theo là các cặp, cách nhau bởi một dấu cách trống. Output Trên dòng riêng biệt, đầu ra cho dù thuật toán Billy Jean của là đúng. Đầu ra "YES" (không có dấu ngoặc kép) nếu nó là hay "NO" (không có dấu ngoặc kép), nếu nó không phải là.






























đ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: