F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

find the mincost route

Time Limit: 1000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 13952    Accepted Submission(s): 4849


Problem Description
������N������������֮����һЩ˫���·�����ӣ�����8600����һ������·�ߣ����·�ߴ�A������������ص�A�㣬���辭����·��ΪV1,V2,....VK,V1,��ô��������K>2,����˵�����˳�������������Ҫ����2��������ͬ�ľ��������Ҳ����ظ�����ͬһ������������8600��Ҫ�������һ��������·�ߣ����һ���Խ��Խ�á�
 

Input
��һ����2������N��M��N <= 100, M <= 1000)�����������ĸ����͵�·��������
��������M���ÿ�а���3������a,b,c.����a��b֮����һ��ͨ·��������Ҫ����cԪ(c <= 100)��
 

Output
����ÿ������ʵ����������ҵ�����һ��·�ߵĻ���������ѵ���Сֵ������Ҳ����Ļ������"It's impossible.".
 

Sample Input
3 3 1 2 1 2 3 1 1 3 1 3 3 1 2 1 1 2 3 2 3 1
 

Sample Output
3 It's impossible.
 

Author
8600
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2025 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.001000(s) query 1, Server time : 2025-08-09 10:13:43, Gzip enabled