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

Mining Maps

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


Problem Description
Administrator Selfridge is analyzing possible mining routes on Pandora. He has collected some data in the form of a graph. Your goal is to help him collect some information about each graph.
 

Input
Connections between mines are described beginning with the line ¡±GRAPH BEGIN¡±. Additional lines lists individual mines (nodes), followed (on the same line) by their neighboring mines (edges). The line ¡±GRAPH END¡± ends the list of path descriptions. The entire problem may be repeated as desired, starting from scratch each time. Some mines may appear only as neighboring
mines, without being described on a separate line.
 

Output
Your output should consist one line (for each graph analyzed), consisting of ¡±NODES¡± followed by the number of nodes, followed by ¡±EDGES¡± and the number of edges in the graph.
 

Sample Input
GRAPH BEGIN a b b c GRAPH END GRAPH BEGIN a b c b c d d e f e f GRAPH END
 

Sample Output
NODES 3 EDGES 2 NODES 6 EDGES 7
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-05-11 21:47:14, Gzip enabled