第一行包含一个数T,代表数据组数
每一组测试数据如下:
每组数据用一个回车开头,接下来的两行以“Stops:”和”Lines:”(不包含引号)开头,并且分别包含站点和线路的名称,之间用一个逗号和一个空格隔开。接下来对于每条线路有单独的一行,以线路的名称+” route:”开头,后面包含它经过的站点,之间用一个逗号和一个空格隔开。最后两行告诉你小J与小M的位置。
第一行包含一个数T,代表数据组数
对于每组测试数据,打印单独的一行代表小J的最优线路(详情请见样例数据),保证最优路径存在。
3
Stops: OxfordCircus, PiccadillyCircus, HydeParkCorner, King’sCross, GreenPark, Arsenal, Victoria, Highbury&Islington, LeicesterSquare
Lines: Blue, Cyan
Cyan route: Highbury&Islington, King’sCross, OxfordCircus, GreenPark, Victoria
Blue route: HydeParkCorner, GreenPark, PiccadillyCircus, LeicesterSquare, King’sCross, Arsenal
Johny lives at King’sCross
Michelle lives at GreenPark
Stops: OxfordCircus, PiccadillyCircus, HydeParkCorner, King’sCross, GreenPark, Arsenal, Victoria, Highbury&Islington, LeicesterSquare
Lines: Blue, Cyan
Cyan route: Highbury&Islington, King’sCross, OxfordCircus, GreenPark, Victoria
Blue route: HydeParkCorner, GreenPark, PiccadillyCircus, LeicesterSquare, King’sCross, Arsenal
Johny lives at PiccadillyCircus
Michelle lives at LeicesterSquare
Stops: OxfordCircus, PiccadillyCircus, HydeParkCorner, King’sCross, GreenPark, Arsenal, Victoria, Highbury&Islington, LeicesterSquare
Lines: Blue, Cyan
Cyan route: Highbury&Islington, King’sCross, OxfordCircus, GreenPark, Victoria
Blue route: HydeParkCorner, GreenPark, PiccadillyCircus, LeicesterSquare, King’sCross, Arsenal
Johny lives at Victoria
Michelle lives at HydeParkCorner
optimal travel from King’sCross to GreenPark: 1 line, 3 minutes
optimal travel from PiccadillyCircus to LeicesterSquare: 1 line, 1 minute
optimal travel from Victoria to HydeParkCorner: 2 lines, 7 minutes
站点数<=300000 线路数<=100000 线路总长度<=1000000 名称长度<=50 名称可以包括字母、数字、减号(-)、单引号(')、and标志(&),保证没有自环。