Logo
(追記) (追記ここまで)

5248번 - Hauling Ore 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB99211926.027%

문제

Administrator Selfridge is analyzing possible mining routes on Pandora. He has collected some data in the form of a graph. The latest ore carriers can visit exactly 3 mining camps. Your goal is to help him find out which mines may be visited from other mines with 2 stops (but not fewer).

입력

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 next lines list mines for which answers need to be calculated, each on a single line. Following these lines, a completely new instance of the problem can be given, starting from scratch.

Some mines may appear only as neighboring mines, without being described on a separate line. Mine names can be arbitrary strings, as long as they don’t contain any whitespace.

출력

Your output should consist one line (for each mine analyzed), consisting of the name of the mine, followed by the mines, in alphabetical order, that can be visited with exactly 2 stops but not fewer, starting from the given mine.

제한

출력 형식

정확한 출력 형식은 제출에서 언어를 Java로 설정하면 확인할 수 있다.

예제 입력 1

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

예제 출력 1

d 
e f 
d 
a c 
b f 
b e 

힌트

출처

School > University of Maryland High School Programming Contest > HSPC 2010 연습 세션 P3번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /