ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1770. The Party of Ural Champions

Tavrida NU: TTL300 How to solve it? [2] // Problem 1770. The Party of Ural Champions 11 Apr 2010 18:11
Hi, can anybody give a hint how to solve this problem?
Chmel_Tolstiy Re: How to solve it? // Problem 1770. The Party of Ural Champions 11 Apr 2010 21:58
Floyd.
Khúc Anh Tuấn Re: How to solve it? // Problem 1770. The Party of Ural Champions 12 Apr 2010 09:31
Notice that if there is an edge between i and j then a[i][j] + a[j][i] <= 1 (a is input array). The reverse is not true, but you no need to worry as unnecessary edges do not change the array a. So you have a graph, run Floyd to check if it matches with array a.