#Lutece0738. floyd
floyd
Migrated from Lutece 738 floyd
All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.
Description
已知个点两两之间的最短路,求个点之间最少需要连接多少条有向边才能使得两两之间的最短路满足所给方阵
Input
包含多组数据。对于每组数据,第一行包含一个数(),表示点的个数,接下来的行每行包含个非负整数,其中第行第个数表示第个点到第个点的最短路长度()
Output
每组数据包含一行,即最少路径条数,若不存在输出
Samples
Resources
2013 UESTC ACM Training for Graph Theory