튜브 어딘가에 ...하지만 어떤 라인에?


26

런던 지하철 일명 튜브는 세계에서 가장 오래된 지하철, 그것은 현재 ( "에지웨어로드"와 "해머"각각 두 위치를 차지하기 때문에 엄격하게 269 ** 스테이션) 267 개라는 이름의 역을 서비스 * 열한 라인으로 구성되어있다

도전

이름으로 주어진 스테이션을 서비스하는 회선의 이름을 입력으로 출력하십시오.

입력 :
문자열 또는 문자 목록

  • 이것은 유효한 스테이션 이름 으로 간주 될 수 있습니다 (아래 코드 블록에 나열되어 있음).

  • 원하는 경우 &입력 내용 중 하나라도 일관성 있게 단어 and(또는 And)로 가정 할 수 있습니다 .

출력 : 해당 스테이션에 서비스를 제공하는 11 개의 라인을 출력하는
분리 된 출력 :

  • 문자열 목록, 문자 목록, 인쇄 된 텍스트, 문자열, 문자 목록; 의심스러운 경우 물어보십시오.

  • 원한다면 단어 대신에 단어 (또는 )를 일관되게 출력 할 수 있습니다 .andAnd&

  • 인쇄 또는 구분자 문자열 사용은 라인 이름 중 어느 하나에 존재하지 않는다고하는 문자열 또는 목록을 반환하는 경우 (포함하는 경고와 함께 &또는 and또는 And세퍼레이터와 같은 단일 공백 문자의 때문에 제외 사용 - 사용) .

Tube Network :
-참고 : 맞춤법 오류가 포함 된 경우에도 최종 상태입니다 (응답 전에 해결되지 않은 경우)

Input (Station Name)         : Output (list of tube line names)
----------------------------------------------------------------------------------------------------------------
"Acton Town"                 : ["District","Piccadilly"]
"Aldgate"                    : ["Circle","Metropolitan"]
"Aldgate East"               : ["District","Hammersmith & City"]
"Alperton"                   : ["Piccadilly"]
"Amersham"                   : ["Metropolitan"]
"Angel"                      : ["Northern"]
"Archway"                    : ["Northern"]
"Arnos Grove"                : ["Piccadilly"]
"Arsenal"                    : ["Piccadilly"]
"Baker Street"               : ["Bakerloo","Circle","Hammersmith & City","Jubilee","Metropolitan"]
"Balham"                     : ["Northern"]
"Bank"                       : ["Central","Northern","Waterloo & City"]
"Barbican"                   : ["Circle","Hammersmith & City","Metropolitan"]
"Barking"                    : ["District","Hammersmith & City"]
"Barkingside"                : ["Central"]
"Barons Court"               : ["District","Piccadilly"]
"Bayswater"                  : ["Circle","District"]
"Becontree"                  : ["District"]
"Belsize Park"               : ["Northern"]
"Bermondsey"                 : ["Jubilee"]
"Bethnal Green"              : ["Central"]
"Blackfriars"                : ["Circle","District"]
"Blackhorse Road"            : ["Victoria"]
"Bond Street"                : ["Central","Jubilee"]
"Borough"                    : ["Northern"]
"Boston Manor"               : ["Piccadilly"]
"Bounds Green"               : ["Piccadilly"]
"Bow Road"                   : ["District","Hammersmith & City"]
"Brent Cross"                : ["Northern"]
"Brixton"                    : ["Victoria"]
"Bromley-by-Bow"             : ["District","Hammersmith & City"]
"Buckhurst Hill"             : ["Central"]
"Burnt Oak"                  : ["Northern"]
"Caledonian Road"            : ["Piccadilly"]
"Camden Town"                : ["Northern"]
"Canada Water"               : ["Jubilee"]
"Canary Wharf"               : ["Jubilee"]
"Canning Town"               : ["Jubilee"]
"Cannon Street"              : ["Circle","District"]
"Canons Park"                : ["Jubilee"]
"Chalfont & Latimer"         : ["Metropolitan"]
"Chalk Farm"                 : ["Northern"]
"Chancery Lane"              : ["Central"]
"Charing Cross"              : ["Bakerloo","Northern"]
"Chesham"                    : ["Metropolitan"]
"Chigwell"                   : ["Central"]
"Chiswick Park"              : ["District"]
"Chorleywood"                : ["Metropolitan"]
"Clapham Common"             : ["Northern"]
"Clapham North"              : ["Northern"]
"Clapham South"              : ["Northern"]
"Cockfosters"                : ["Piccadilly"]
"Colindale"                  : ["Northern"]
"Colliers Wood"              : ["Northern"]
"Covent Garden"              : ["Piccadilly"]
"Croxley"                    : ["Metropolitan"]
"Dagenham East"              : ["District"]
"Dagenham Heathway"          : ["District"]
"Debden"                     : ["Central"]
"Dollis Hill"                : ["Jubilee"]
"Ealing Broadway"            : ["Central","District"]
"Ealing Common"              : ["District","Piccadilly"]
"Earl's Court"               : ["District","Piccadilly"]
"East Acton"                 : ["Central"]
"East Finchley"              : ["Northern"]
"East Ham"                   : ["District","Hammersmith & City"]
"East Putney"                : ["District"]
"Eastcote"                   : ["Metropolitan","Piccadilly"]
"Edgware"                    : ["Northern"]
"Edgware Road"               : ["Bakerloo","Circle","District","Hammersmith & City"]
"Elephant & Castle"          : ["Bakerloo","Northern"]
"Elm Park"                   : ["District"]
"Embankment"                 : ["Bakerloo","Circle","District","Northern"]
"Epping"                     : ["Central"]
"Euston"                     : ["Northern","Victoria"]
"Euston Square"              : ["Circle","Hammersmith & City","Metropolitan"]
"Fairlop"                    : ["Central"]
"Farringdon"                 : ["Circle","Hammersmith & City","Metropolitan"]
"Finchley Central"           : ["Northern"]
"Finchley Road"              : ["Jubilee","Metropolitan"]
"Finsbury Park"              : ["Piccadilly","Victoria"]
"Fulham Broadway"            : ["District"]
"Gants Hill"                 : ["Central"]
"Gloucester Road"            : ["Circle","District","Piccadilly"]
"Golders Green"              : ["Northern"]
"Goldhawk Road"              : ["Circle","Hammersmith & City"]
"Goodge Street"              : ["Northern"]
"Grange Hill"                : ["Central"]
"Great Portland Street"      : ["Circle","Hammersmith & City","Metropolitan"]
"Greenford"                  : ["Central"]
"Green Park"                 : ["Jubilee","Piccadilly","Victoria"]
"Gunnersbury"                : ["District"]
"Hainault"                   : ["Central"]
"Hammersmith"                : ["Circle","District","Hammersmith & City","Piccadilly"]
"Hampstead"                  : ["Northern"]
"Hanger Lane"                : ["Central"]
"Harlesden"                  : ["Bakerloo"]
"Harrow & Wealdstone"        : ["Bakerloo"]
"Harrow-on-the-Hill"         : ["Metropolitan"]
"Hatton Cross"               : ["Piccadilly"]
"Heathrow Terminals 1, 2, 3" : ["Piccadilly"]
"Heathrow Terminal 4"        : ["Piccadilly"]
"Heathrow Terminal 5"        : ["Piccadilly"]
"Hendon Central"             : ["Northern"]
"High Barnet"                : ["Northern"]
"Highbury & Islington"       : ["Victoria"]
"Highgate"                   : ["Northern"]
"High Street Kensington"     : ["Circle","District"]
"Hillingdon"                 : ["Metropolitan","Piccadilly"]
"Holborn"                    : ["Central","Piccadilly"]
"Holland Park"               : ["Central"]
"Holloway Road"              : ["Piccadilly"]
"Hornchurch"                 : ["District"]
"Hounslow Central"           : ["Piccadilly"]
"Hounslow East"              : ["Piccadilly"]
"Hounslow West"              : ["Piccadilly"]
"Hyde Park Corner"           : ["Piccadilly"]
"Ickenham"                   : ["Metropolitan","Piccadilly"]
"Kennington"                 : ["Northern"]
"Kensal Green"               : ["Bakerloo"]
"Kensington (Olympia)"       : ["District"]
"Kentish Town"               : ["Northern"]
"Kenton"                     : ["Bakerloo"]
"Kew Gardens"                : ["District"]
"Kilburn"                    : ["Jubilee"]
"Kilburn Park"               : ["Bakerloo"]
"Kingsbury"                  : ["Jubilee"]
"King's Cross St. Pancras"   : ["Circle","Hammersmith & City","Metropolitan","Northern","Piccadilly","Victoria"]
"Knightsbridge"              : ["Piccadilly"]
"Ladbroke Grove"             : ["Circle","Hammersmith & City"]
"Lambeth North"              : ["Bakerloo"]
"Lancaster Gate"             : ["Central"]
"Latimer Road"               : ["Circle","Hammersmith & City"]
"Leicester Square"           : ["Northern","Piccadilly"]
"Leyton"                     : ["Central"]
"Leytonstone"                : ["Central"]
"Liverpool Street"           : ["Central","Circle","Hammersmith & City","Metropolitan"]
"London Bridge"              : ["Jubilee","Northern"]
"Loughton"                   : ["Central"]
"Maida Vale"                 : ["Bakerloo"]
"Manor House"                : ["Piccadilly"]
"Mansion House"              : ["Circle","District"]
"Marble Arch"                : ["Central"]
"Marylebone"                 : ["Bakerloo"]
"Mile End"                   : ["Central","District","Hammersmith & City"]
"Mill Hill East"             : ["Northern"]
"Monument"                   : ["Circle","District"]
"Moorgate"                   : ["Circle","Hammersmith & City","Metropolitan","Northern"]
"Moor Park"                  : ["Metropolitan"]
"Morden"                     : ["Northern"]
"Mornington Crescent"        : ["Northern"]
"Neasden"                    : ["Jubilee"]
"Newbury Park"               : ["Central"]
"North Acton"                : ["Central"]
"North Ealing"               : ["Piccadilly"]
"North Greenwich"            : ["Jubilee"]
"North Harrow"               : ["Metropolitan"]
"North Wembley"              : ["Bakerloo"]
"Northfields"                : ["Piccadilly"]
"Northolt"                   : ["Central"]
"Northwick Park"             : ["Metropolitan"]
"Northwood"                  : ["Metropolitan"]
"Northwood Hills"            : ["Metropolitan"]
"Notting Hill Gate"          : ["Central","Circle","District"]
"Oakwood"                    : ["Piccadilly"]
"Old Street"                 : ["Northern"]
"Osterley"                   : ["Piccadilly"]
"Oval"                       : ["Northern"]
"Oxford Circus"              : ["Bakerloo","Central","Victoria"]
"Paddington"                 : ["Bakerloo","Circle","District","Hammersmith & City"]
"Park Royal"                 : ["Piccadilly"]
"Parsons Green"              : ["District"]
"Perivale"                   : ["Central"]
"Piccadilly Circus"          : ["Bakerloo","Piccadilly"]
"Pimlico"                    : ["Victoria"]
"Pinner"                     : ["Metropolitan"]
"Plaistow"                   : ["District","Hammersmith & City"]
"Preston Road"               : ["Metropolitan"]
"Putney Bridge"              : ["District"]
"Queen's Park"               : ["Bakerloo"]
"Queensbury"                 : ["Jubilee"]
"Queensway"                  : ["Central"]
"Ravenscourt Park"           : ["District"]
"Rayners Lane"               : ["Metropolitan","Piccadilly"]
"Redbridge"                  : ["Central"]
"Regent's Park"              : ["Bakerloo"]
"Richmond"                   : ["District"]
"Rickmansworth"              : ["Metropolitan"]
"Roding Valley"              : ["Central"]
"Royal Oak"                  : ["Circle","Hammersmith & City"]
"Ruislip"                    : ["Metropolitan","Piccadilly"]
"Ruislip Gardens"            : ["Central"]
"Ruislip Manor"              : ["Metropolitan","Piccadilly"]
"Russell Square"             : ["Piccadilly"]
"St. James's Park"           : ["Circle","District"]
"St. John's Wood"            : ["Jubilee"]
"St. Paul's"                 : ["Central"]
"Seven Sisters"              : ["Victoria"]
"Shepherd's Bush"            : ["Central"]
"Shepherd's Bush Market"     : ["Circle","Hammersmith & City"]
"Sloane Square"              : ["Circle","District"]
"Snaresbrook"                : ["Central"]
"South Ealing"               : ["Piccadilly"]
"South Harrow"               : ["Piccadilly"]
"South Kensington"           : ["Circle","District","Piccadilly"]
"South Kenton"               : ["Bakerloo"]
"South Ruislip"              : ["Central"]
"South Wimbledon"            : ["Northern"]
"South Woodford"             : ["Central"]
"Southfields"                : ["District"]
"Southgate"                  : ["Piccadilly"]
"Southwark"                  : ["Jubilee"]
"Stamford Brook"             : ["District"]
"Stanmore"                   : ["Jubilee"]
"Stepney Green"              : ["District","Hammersmith & City"]
"Stockwell"                  : ["Northern","Victoria"]
"Stonebridge Park"           : ["Bakerloo"]
"Stratford"                  : ["Central","Jubilee"]
"Sudbury Hill"               : ["Piccadilly"]
"Sudbury Town"               : ["Piccadilly"]
"Swiss Cottage"              : ["Jubilee"]
"Temple"                     : ["Circle","District"]
"Theydon Bois"               : ["Central"]
"Tooting Bec"                : ["Northern"]
"Tooting Broadway"           : ["Northern"]
"Tottenham Court Road"       : ["Central","Northern"]
"Tottenham Hale"             : ["Victoria"]
"Totteridge & Whetstone"     : ["Northern"]
"Tower Hill"                 : ["Circle","District"]
"Tufnell Park"               : ["Northern"]
"Turnham Green"              : ["District","Piccadilly"]
"Turnpike Lane"              : ["Piccadilly"]
"Upminster"                  : ["District"]
"Upminster Bridge"           : ["District"]
"Upney"                      : ["District"]
"Upton Park"                 : ["District","Hammersmith & City"]
"Uxbridge"                   : ["Metropolitan","Piccadilly"]
"Vauxhall"                   : ["Victoria"]
"Victoria"                   : ["Circle","District","Victoria"]
"Walthamstow Central"        : ["Victoria"]
"Wanstead"                   : ["Central"]
"Warren Street"              : ["Northern","Victoria"]
"Warwick Avenue"             : ["Bakerloo"]
"Waterloo"                   : ["Bakerloo","Jubilee","Northern","Waterloo & City"]
"Watford"                    : ["Metropolitan"]
"Wembley Central"            : ["Bakerloo"]
"Wembley Park"               : ["Jubilee","Metropolitan"]
"West Acton"                 : ["Central"]
"West Brompton"              : ["District"]
"West Finchley"              : ["Northern"]
"West Ham"                   : ["District","Hammersmith & City","Jubilee"]
"West Hampstead"             : ["Jubilee"]
"West Harrow"                : ["Metropolitan"]
"West Kensington"            : ["District"]
"West Ruislip"               : ["Central"]
"Westbourne Park"            : ["Circle","Hammersmith & City"]
"Westminster"                : ["Circle","District","Jubilee"]
"White City"                 : ["Central"]
"Whitechapel"                : ["District","Hammersmith & City"]
"Willesden Green"            : ["Jubilee"]
"Willesden Junction"         : ["Bakerloo"]
"Wimbledon"                  : ["District"]
"Wimbledon Park"             : ["District"]
"Wood Green"                 : ["Piccadilly"]
"Wood Lane"                  : ["Circle","Hammersmith & City"]
"Woodford"                   : ["Central"]
"Woodside Park"              : ["Northern"]

... 11 개의 라인 이름은 다음과 같습니다.

Bakerloo
Central
Circle
District
Hammersmith & City
Jubilee
Metropolitan
Northern
Piccadilly
Victoria
Waterloo & City

* 교통 런던의 경우 다른 열차 노선도 관리하므로 일부는 "튜브"(일부 "Docklands 경전철"또는 "DLR")의 일부라고 할 수 있지만 여기에 나열된 11 개를 준수해야합니다.

** 링크 된 Wikipedia 페이지에는 현재 270이 있지만 "DLR"에만 서비스를 제공하지만 카나리 워프의 두 번째 위치를 잘못 계산하고 있다고 생각합니다.)


사용 golfed 제출 가상 브라우니 포인트 (너무 가장 가능성이 많은 upvotes)의 힙 모닝 초승달을 (호환 IDE를 사용할 수 있습니다 여기에 )!


이것은 이므로 언어별로 바이트 단위로 가장 짧은 코드가 승리하고 가장 짧은 솔루션이 승리합니다 (골프 언어가 다른 언어로 골프를 치지 못하게하십시오). 즐기세요!


1
난 그냥 떠날거야 여기에. 이 답변을 제출하고 싶지 않습니다. > _> 나는 ... 얼마나 큰지 깨닫지 못했습니다 ... 이건 ...
완전히 인간적인

2
@icrieverytim :) 골프 장갑을 끼십시오 :
Jonathan Allan

그래서 그것은 단지 ... 일련의 튜브입니다 . ¯ \ _ (ツ) _ / ¯
Arnauld

2
@Arnauld 물론, 전혀 그렇지 않습니다. "튜브에 닿을 수 있습니다", "튜브를 바꿀 수 있습니다", "잘못된 튜브에있을 수 있습니다", "첫 번째 튜브를 낳을 수 있습니다"또는 "마지막 튜브를 낳을 수 있습니다"... 단 하나의 튜브 만 있습니다 :)
Jonathan Allan

3
이제 Jay Foreman과 함께 노래하십시오 .
TRiG

답변:


14

Mathematica 8+, 266 바이트

t=Merge[Cases[<<ExamplePages/TripPlanning.nb,_@v__~_~{_->l_}:>(#->l&/@{v}),-1],Union@@#&];
x(r=t@@Nearest[Keys@t]@StringReplace[__~~"d Lane"|"ket"->"Royal Oak"]@x;DeleteCases[
  If[x<>r[[1]]//StringFreeQ@"sm",{},{"Circle"}]⋃r,"Overground"|"Docklands Light Rail"])

이 솔루션은 원래 스테이션과 동일한 바이트 수를 가졌습니다. 나는 그것이 50 바이트 정도 더 떨어질 수 있다고 생각하지만, 이것은 지금 막을 적당한 곳처럼 보였다.


소개

Mathematica는 대규모 표준 라이브러리 및 대규모 온라인 "계산 가능한 기술 자료"에 대한 액세스로 유명합니다. 관련 대중 교통 데이터를 쉽게 찾을 수 있기를 바라면서 Wolfram | Alpha를 뻔뻔스럽게 검색했지만 검색어의 도메인을 이해했지만 데이터를 아직 사용할 수 없습니다 .

다행스럽게도 Mathematica의 광범위한 내장 문서는 깔끔한 예제와 함께 제공됩니다. 이러한 페이지 중 일부는 London Underground 네트워크를 사용하여 그래프 관련 기능을 보여줍니다. 짧은 이름으로 인해 "여행 계획"추천 예제 의 그래프를 사용합니다 .

동일한 네트워크의 다른 멋진 사용법이 있습니다 .

프로그래밍 방식으로 Mathematica의 자체 문서에 액세스하는 것은 "외부 소스에서 가져 오기" 유형 허점에 속한다고 생각하지 않습니다 .


예제 페이지 가져 오기

예제 페이지를 노트북 표현식 으로 가져올 수 있습니다 .

<<ExamplePages/TripPlanning.nb
Notebook[{Cell[ ... ], ... }, Saveable -> False, ...]

노트북 표현식 내부에서 전체 그래프를 추출 할 수 있습니다.

g = FirstCase[<< ExamplePages/TripPlanning.nb, _Graph, , -1];
VertexList[g]
{"Acton Central", "Acton Town", "Aldgate", ...}  

그래프의 꼭짓점은 스테이션 이름 일뿐입니다. 모서리에는 "Lines"두 스테이션 사이를 통과하는 선을 나타내는 문자열 목록 인 사용자 정의 특성이 있습니다.

# -> PropertyValue[{g, #}, "Lines"] & /@ EdgeList[g]
{...,
 "Acton Town" <-> "Chiswick Park" -> {"District"}, 
 "Acton Town" <-> "Ealing Common" -> {"District", "Piccadilly"},
 ...}

이제 모든 입사 모서리를에서 가져오고 IncidenceList[g, vertex]매핑 하는 등을 통해 정점을 통과하는 모든 선을 찾을 PropertyValue[{g, edge}, "Lines"]수 있습니다.

그러나 위의 방법을 건너 뛰고 Graph생성자 의 관련 부분 ( Properties옵션)에 대해 패턴 일치로 많은 바이트를 저장 합니다 .

라인을 추출

Graph생성자의 형식은 다음과 같습니다

Graph[
  {v1, v2, ...},
  {e1, e2, ...},
  Properties -> {
    v1 -> {propertyName -> propertyValue},
    e1 -> {propertyName -> propertyValue},   (* one edge property *)
    ...
  }
]

( 전체 경로에 대한 – FullForm[g]의 소스 코드를 검사 하거나 읽으면 이를 확인할 수 있습니다 .)TripPlanning.nbFindFile["ExamplePages/TripPlanning.nb"]

다음은 하나의 edge 속성의 예입니다.

UndirectedEdge["Embankment", "Waterloo"] -> {"Lines" -> {"Bakerloo", "Northern"}}

이 표현을 간단한 패턴으로 바꾸자.

UndirectedEdge[v1_, v2_]  ->      {"Lines" -> lines_}
UndirectedEdge[v1_, v2_]  ~Rule~  {"Lines" -> lines_}
UndirectedEdge[v__]       ~Rule~  {_       -> lines_}
             _[v__]       ~Rule~  {_       -> l_    }
             _@v__        ~_~     {_       -> l_    }

             _@v__~_~{_->l_}

룩업 테이블 만들기

이제 우리는 일치시킬 수 있습니다 v1, v2그리고 lines, 그러나 우리는 할 {v1 -> lines, v2 -> lines}. 유용하게도 Cases패턴을 동시에 일치시켜 변환 할 수 있습니다.

Cases[notebook,  _@v__~_~{_->l_} :> (# -> l & /@ { v }),  -1]
                 [ the pattern ]    [ the replacement ]

이것은 양식 목록을 생성합니다 {{v1 -> lines, v2 -> lines}, {v1 -> lines, v3 -> lines}, ...}. 마지막으로 정점별로 목록을 병합합니다.

t=Merge[Cases[...], Union@@#&];

90 바이트 미만으로 각 스테이션의 회선에 대해 거의 완벽한 조회 테이블을 생성했습니다.

t=Merge[Cases[<<ExamplePages/TripPlanning.nb,_@s__~_~{_->l_}:>(#->l&/@{s}),-1],Union@@#&]
<| "Embankment"       -> {"Bakerloo", "Circle", "District", "Northern"},
   "Waterloo"         -> {"Bakerloo", "Jubilee", "Northern", "Waterloo & City"},
   "Brondesbury"      -> {"Overground"},
    ... |>

오타 수정

불행히도 일부 스테이션 이름의 철자가 틀리거나 누락되었습니다.

퍼지 문자열 일치는 오타를 처리해야합니다. Nearest철자가 틀린 스테이션 이름을 입력 스테이션 이름으로 찾을 수 있습니다 .

Nearest[Keys@t]

세 스테이션은 동일한 라인을 공유하므로 "Wood Lane""Shepherd's Bush Market"(신규 스테이션)의 입력을로 교체하십시오 "Royal Oak".

StringReplace[__ ~~ "d Lane" | "ket" -> "Royal Oak"]

해당 기능을 구성하여 가짜 스테이션 이름을 가져 와서 테이블에서 해당 라인을 찾아 다음에 저장하십시오 r.

r=t@@Nearest[Keys@t]@StringReplace[__~~"d Lane"|"ket"->"Royal Oak"]@x

구식 수정

Circle Line 점검으로 인해 네트워크도 약간 구식입니다.

입력 스테이션이 "Hammersmith"있거나 조회 테이블이을 리턴 하는 경우 행에 {"Hammersmith & City"}추가 "Circle"하십시오.

If[x <> r[[1]] // StringFreeQ@"sm", {}, {"Circle"}] ⋃ r

불필요한 라인 제거

그래프에는 우리가 신경 쓰지 않는 선이 포함되어 있으므로 제거하십시오.

DeleteCases[..., "Overground"|"Docklands Light Rail"]

그게 다야!


시도 해봐! (해결 방법)

내 솔루션으로 놀고 싶지만 Mathematica가없는 경우 무료 Wolfram Programming Cloud를 사용할 수 있습니다. 여기로 이동하여을 클릭 Create a New Notebook한 다음 잠시 기다리십시오.

불행히도, 플랫폼에는 노트북 가져 오기 코드가 작동하지 못하게하는 몇 가지 제한 사항이 있습니다. 몇 가지 조잡한 해결 방법은 다음과 같습니다.

예제 페이지가 없으므로 온라인 문서에서 클립 보드로 복사 기능을 남용 할 수 있습니다. 브라우저의 개발자 도구를 사용하여 http://reference.wolfram.com/language/example/Files/TripPlanning.en/i_1.txt(경고 : 큰) 요청이있는 것을 보았습니다 . 그러나 플랫폼의 프록시는 도메인을 확인하지 않으므로 reference.wolfram.com수동으로 수행했습니다.

gWorkaround = ToExpression[
  FirstCase[
    Import["http://140.177.205.163/language/example/Files/TripPlanning.en/i_1.txt",
      {"HTML","XMLObject"}],
    XMLElement["pre", _, {a_}] :> a,
    ,-1
  ],
  InputForm, Hold];

이것을 먼저 붙여 넣고을 눌러 shift+enter실행하십시오. 이제 교체 <<ExamplePages/TripPlanning.nb와 함께 gWorkaround.


테스트 데이터

함수를 호출하고 f주어진 데이터에서 테스트하십시오.

f = %;

testData = <|"Acton Town" -> {"District", "Piccadilly"}, "Aldgate" -> {"Circle", "Metropolitan"}, "Aldgate East" -> {"District", "Hammersmith & City"}, "Alperton" -> {"Piccadilly"}, "Amersham" -> {"Metropolitan"}, "Angel" -> {"Northern"}, "Archway" -> {"Northern"}, "Arnos Grove" -> {"Piccadilly"}, "Arsenal" -> {"Piccadilly"}, "Baker Street" -> {"Bakerloo", "Circle", "Hammersmith & City", "Jubilee", "Metropolitan"}, "Balham" -> {"Northern"}, "Bank" -> {"Central", "Northern", "Waterloo & City"}, "Barbican" -> {"Circle", "Hammersmith & City", "Metropolitan"}, "Barking" -> {"District", "Hammersmith & City"}, "Barkingside" -> {"Central"}, "Barons Court" -> {"District", "Piccadilly"}, "Bayswater" -> {"Circle", "District"}, "Becontree" -> {"District"}, "Belsize Park" -> {"Northern"}, "Bermondsey" -> {"Jubilee"}, "Bethnal Green" -> {"Central"}, "Blackfriars" -> {"Circle", "District"}, "Blackhorse Road" -> {"Victoria"}, "Bond Street" -> {"Central", "Jubilee"}, "Borough" -> {"Northern"}, "Boston Manor" -> {"Piccadilly"}, "Bounds Green" -> {"Piccadilly"}, "Bow Road" -> {"District", "Hammersmith & City"}, "Brent Cross" -> {"Northern"}, "Brixton" -> {"Victoria"}, "Bromley-by-Bow" -> {"District", "Hammersmith & City"}, "Buckhurst Hill" -> {"Central"}, "Burnt Oak" -> {"Northern"}, "Caledonian Road" -> {"Piccadilly"}, "Camden Town" -> {"Northern"}, "Canada Water" -> {"Jubilee"}, "Canary Wharf" -> {"Jubilee"}, "Canning Town" -> {"Jubilee"}, "Cannon Street" -> {"Circle", "District"}, "Canons Park" -> {"Jubilee"}, "Chalfont & Latimer" -> {"Metropolitan"}, "Chalk Farm" -> {"Northern"}, "Chancery Lane" -> {"Central"}, "Charing Cross" -> {"Bakerloo", "Northern"}, "Chesham" -> {"Metropolitan"}, "Chigwell" -> {"Central"}, "Chiswick Park" -> {"District"}, "Chorleywood" -> {"Metropolitan"}, "Clapham Common" -> {"Northern"}, "Clapham North" -> {"Northern"}, "Clapham South" -> {"Northern"}, "Cockfosters" -> {"Piccadilly"}, "Colindale" -> {"Northern"}, "Colliers Wood" -> {"Northern"}, "Covent Garden" -> {"Piccadilly"}, "Croxley" -> {"Metropolitan"}, "Dagenham East" -> {"District"}, "Dagenham Heathway" -> {"District"}, "Debden" -> {"Central"}, "Dollis Hill" -> {"Jubilee"}, "Ealing Broadway" -> {"Central", "District"}, "Ealing Common" -> {"District", "Piccadilly"}, "Earl's Court" -> {"District", "Piccadilly"}, "East Acton" -> {"Central"}, "East Finchley" -> {"Northern"}, "East Ham" -> {"District", "Hammersmith & City"}, "East Putney" -> {"District"}, "Eastcote" -> {"Metropolitan", "Piccadilly"}, "Edgware" -> {"Northern"}, "Edgware Road" -> {"Bakerloo", "Circle", "District", "Hammersmith & City"}, "Elephant & Castle" -> {"Bakerloo", "Northern"}, "Elm Park" -> {"District"}, "Embankment" -> {"Bakerloo", "Circle", "District", "Northern"}, "Epping" -> {"Central"}, "Euston" -> {"Northern", "Victoria"}, "Euston Square" -> {"Circle", "Hammersmith & City", "Metropolitan"}, "Fairlop" -> {"Central"}, "Farringdon" -> {"Circle", "Hammersmith & City", "Metropolitan"}, "Finchley Central" -> {"Northern"}, "Finchley Road" -> {"Jubilee", "Metropolitan"}, "Finsbury Park" -> {"Piccadilly", "Victoria"}, "Fulham Broadway" -> {"District"}, "Gants Hill" -> {"Central"}, "Gloucester Road" -> {"Circle", "District", "Piccadilly"}, "Golders Green" -> {"Northern"}, "Goldhawk Road" -> {"Circle", "Hammersmith & City"}, "Goodge Street" -> {"Northern"}, "Grange Hill" -> {"Central"}, "Great Portland Street" -> {"Circle", "Hammersmith & City", "Metropolitan"}, "Greenford" -> {"Central"}, "Green Park" -> {"Jubilee", "Piccadilly", "Victoria"}, "Gunnersbury" -> {"District"}, "Hainault" -> {"Central"}, "Hammersmith" -> {"Circle", "District", "Hammersmith & City", "Piccadilly"}, "Hampstead" -> {"Northern"}, "Hanger Lane" -> {"Central"}, "Harlesden" -> {"Bakerloo"}, "Harrow & Wealdstone" -> {"Bakerloo"}, "Harrow-on-the-Hill" -> {"Metropolitan"}, "Hatton Cross" -> {"Piccadilly"}, "Heathrow Terminals 1, 2, 3" -> {"Piccadilly"}, "Heathrow Terminal 4" -> {"Piccadilly"}, "Heathrow Terminal 5" -> {"Piccadilly"}, "Hendon Central" -> {"Northern"}, "High Barnet" -> {"Northern"}, "Highbury & Islington" -> {"Victoria"}, "Highgate" -> {"Northern"}, "High Street Kensington" -> {"Circle", "District"}, "Hillingdon" -> {"Metropolitan", "Piccadilly"}, "Holborn" -> {"Central", "Piccadilly"}, "Holland Park" -> {"Central"}, "Holloway Road" -> {"Piccadilly"}, "Hornchurch" -> {"District"}, "Hounslow Central" -> {"Piccadilly"}, "Hounslow East" -> {"Piccadilly"}, "Hounslow West" -> {"Piccadilly"}, "Hyde Park Corner" -> {"Piccadilly"}, "Ickenham" -> {"Metropolitan", "Piccadilly"}, "Kennington" -> {"Northern"}, "Kensal Green" -> {"Bakerloo"}, "Kensington (Olympia)" -> {"District"}, "Kentish Town" -> {"Northern"}, "Kenton" -> {"Bakerloo"}, "Kew Gardens" -> {"District"}, "Kilburn" -> {"Jubilee"}, "Kilburn Park" -> {"Bakerloo"}, "Kingsbury" -> {"Jubilee"}, "King's Cross St. Pancras" -> {"Circle", "Hammersmith & City", "Metropolitan", "Northern", "Piccadilly", "Victoria"}, "Knightsbridge" -> {"Piccadilly"}, "Ladbroke Grove" -> {"Circle", "Hammersmith & City"}, "Lambeth North" -> {"Bakerloo"}, "Lancaster Gate" -> {"Central"}, "Latimer Road" -> {"Circle", "Hammersmith & City"}, "Leicester Square" -> {"Northern", "Piccadilly"}, "Leyton" -> {"Central"}, "Leytonstone" -> {"Central"}, "Liverpool Street" -> {"Central", "Circle", "Hammersmith & City", "Metropolitan"}, "London Bridge" -> {"Jubilee", "Northern"}, "Loughton" -> {"Central"}, "Maida Vale" -> {"Bakerloo"}, "Manor House" -> {"Piccadilly"}, "Mansion House" -> {"Circle", "District"}, "Marble Arch" -> {"Central"}, "Marylebone" -> {"Bakerloo"}, "Mile End" -> {"Central", "District", "Hammersmith & City"}, "Mill Hill East" -> {"Northern"}, "Monument" -> {"Circle", "District"}, "Moorgate" -> {"Circle", "Hammersmith & City", "Metropolitan", "Northern"}, "Moor Park" -> {"Metropolitan"}, "Morden" -> {"Northern"}, "Mornington Crescent" -> {"Northern"}, "Neasden" -> {"Jubilee"}, "Newbury Park" -> {"Central"}, "North Acton" -> {"Central"}, "North Ealing" -> {"Piccadilly"}, "North Greenwich" -> {"Jubilee"}, "North Harrow" -> {"Metropolitan"}, "North Wembley" -> {"Bakerloo"}, "Northfields" -> {"Piccadilly"}, "Northolt" -> {"Central"}, "Northwick Park" -> {"Metropolitan"}, "Northwood" -> {"Metropolitan"}, "Northwood Hills" -> {"Metropolitan"}, "Notting Hill Gate" -> {"Central", "Circle", "District"}, "Oakwood" -> {"Piccadilly"}, "Old Street" -> {"Northern"}, "Osterley" -> {"Piccadilly"}, "Oval" -> {"Northern"}, "Oxford Circus" -> {"Bakerloo", "Central", "Victoria"}, "Paddington" -> {"Bakerloo", "Circle", "District", "Hammersmith & City"}, "Park Royal" -> {"Piccadilly"}, "Parsons Green" -> {"District"}, "Perivale" -> {"Central"}, "Piccadilly Circus" -> {"Bakerloo", "Piccadilly"}, "Pimlico" -> {"Victoria"}, "Pinner" -> {"Metropolitan"}, "Plaistow" -> {"District", "Hammersmith & City"}, "Preston Road" -> {"Metropolitan"}, "Putney Bridge" -> {"District"}, "Queen's Park" -> {"Bakerloo"}, "Queensbury" -> {"Jubilee"}, "Queensway" -> {"Central"}, "Ravenscourt Park" -> {"District"}, "Rayners Lane" -> {"Metropolitan", "Piccadilly"}, "Redbridge" -> {"Central"}, "Regent's Park" -> {"Bakerloo"}, "Richmond" -> {"District"}, "Rickmansworth" -> {"Metropolitan"}, "Roding Valley" -> {"Central"}, "Royal Oak" -> {"Circle", "Hammersmith & City"}, "Ruislip" -> {"Metropolitan", "Piccadilly"}, "Ruislip Gardens" -> {"Central"}, "Ruislip Manor" -> {"Metropolitan", "Piccadilly"}, "Russell Square" -> {"Piccadilly"}, "St. James's Park" -> {"Circle", "District"}, "St. John's Wood" -> {"Jubilee"}, "St. Paul's" -> {"Central"}, "Seven Sisters" -> {"Victoria"}, "Shepherd's Bush" -> {"Central"}, "Shepherd's Bush Market" -> {"Circle", "Hammersmith & City"}, "Sloane Square" -> {"Circle", "District"}, "Snaresbrook" -> {"Central"}, "South Ealing" -> {"Piccadilly"}, "South Harrow" -> {"Piccadilly"}, "South Kensington" -> {"Circle", "District", "Piccadilly"}, "South Kenton" -> {"Bakerloo"}, "South Ruislip" -> {"Central"}, "South Wimbledon" -> {"Northern"}, "South Woodford" -> {"Central"}, "Southfields" -> {"District"}, "Southgate" -> {"Piccadilly"}, "Southwark" -> {"Jubilee"}, "Stamford Brook" -> {"District"}, "Stanmore" -> {"Jubilee"}, "Stepney Green" -> {"District", "Hammersmith & City"}, "Stockwell" -> {"Northern", "Victoria"}, "Stonebridge Park" -> {"Bakerloo"}, "Stratford" -> {"Central", "Jubilee"}, "Sudbury Hill" -> {"Piccadilly"}, "Sudbury Town" -> {"Piccadilly"}, "Swiss Cottage" -> {"Jubilee"}, "Temple" -> {"Circle", "District"}, "Theydon Bois" -> {"Central"}, "Tooting Bec" -> {"Northern"}, "Tooting Broadway" -> {"Northern"}, "Tottenham Court Road" -> {"Central", "Northern"}, "Tottenham Hale" -> {"Victoria"}, "Totteridge & Whetstone" -> {"Northern"}, "Tower Hill" -> {"Circle", "District"}, "Tufnell Park" -> {"Northern"}, "Turnham Green" -> {"District", "Piccadilly"}, "Turnpike Lane" -> {"Piccadilly"}, "Upminster" -> {"District"}, "Upminster Bridge" -> {"District"}, "Upney" -> {"District"}, "Upton Park" -> {"District", "Hammersmith & City"}, "Uxbridge" -> {"Metropolitan", "Piccadilly"}, "Vauxhall" -> {"Victoria"}, "Victoria" -> {"Circle", "District", "Victoria"}, "Walthamstow Central" -> {"Victoria"}, "Wanstead" -> {"Central"}, "Warren Street" -> {"Northern", "Victoria"}, "Warwick Avenue" -> {"Bakerloo"}, "Waterloo" -> {"Bakerloo", "Jubilee", "Northern", "Waterloo & City"}, "Watford" -> {"Metropolitan"}, "Wembley Central" -> {"Bakerloo"}, "Wembley Park" -> {"Jubilee", "Metropolitan"}, "West Acton" -> {"Central"}, "West Brompton" -> {"District"}, "West Finchley" -> {"Northern"}, "West Ham" -> {"District", "Hammersmith & City", "Jubilee"}, "West Hampstead" -> {"Jubilee"}, "West Harrow" -> {"Metropolitan"}, "West Kensington" -> {"District"}, "West Ruislip" -> {"Central"}, "Westbourne Park" -> {"Circle", "Hammersmith & City"}, "Westminster" -> {"Circle", "District", "Jubilee"}, "White City" -> {"Central"}, "Whitechapel" -> {"District", "Hammersmith & City"}, "Willesden Green" -> {"Jubilee"}, "Willesden Junction" -> {"Bakerloo"}, "Wimbledon" -> {"District"}, "Wimbledon Park" -> {"District"}, "Wood Green" -> {"Piccadilly"}, "Wood Lane" -> {"Circle", "Hammersmith & City"}, "Woodford" -> {"Central"}, "Woodside Park" -> {"Northern"}|>;

KeyValueMap[{#, f[#] == #2} &, testData] // Grid

1
언어는 실제로 필요한 문서와 함께 제공됩니까? 그렇지 않다면 제목이 "Mathematica 8 + (<documentation name>)"이어야한다고 제안 할 것입니다. 분명히 외부 리소스 사용에 경계가 있지만 많은 노력을 기울였습니다 (특히 노트북이 오래 되었기 때문에).
Jonathan Allan

예, Mathematica는 실제로 설명서와 함께 제공됩니다.
hftf

언어가 기본적 으로이 모든 예제 파일과 함께 제공되는 경우 허점이 사용되었다고 생각하지 않습니다 (Mathematica가 무료가 아니기 때문에 이것을 확인할 수 없으므로 다른 사람이 개인적으로 확인에 감사 할 수 있습니다). 어쨌든 위대한 대답!
Jonathan Allan

16

ES6, Node.js / Chrome, 989 977 931 892 889 887 바이트

s=>"Bakerloo,Central,Circle,District,Hammersmith & City,Jubilee,Metropolitan,Northern,Piccadilly,Victoria,Waterloo & City".split`,`.filter((_,i)=>parseInt('7c1w0o741s3k39w22c020c080we80y3l0a8w0t3xhs2olc7g0km87w0176r8ao2e4g0q5w0eeb753mekwx1k18'.substr(" 5Kd5_9 5c4^5];`3]3 4]4^<`Y`0^5h3 9 ;<K 9^2b<`3 Wf9 9`E 0<a;< ; 9`;]2o4b99a33d5`; 3`3jB]Kj9b55e8m5]= KmS ;]K5`9^9]<_3^0 ;]3_3]3 99;b=]K 3 Xe95`9_Qd5_0o3b;];bKf=e=b3jH_<]4d; 3g:d45eT]J_5Kk4{2q9_Kc4c<l9vD`9; 9eIc2^D]<]5a3d8`5hF 4jKhLUm3|5]: ;a5{<> :^3d5t9]5l6_A~f9h5]5b5b9hK]9]: 5l4:a5m9}4^@oHkH^3e3c1c4nBf<bHa:w=b;]AsDl; K`H~K]3d;f8r9 4n9eV]9 <^9~3n=l<]9]5]5a9kK 5 5`: =g:aHcAb2q?_2b0tAsNc;]9]9_3e5e3qAkR^Ac5bK Mc?a;9t=y2_;]5b3_2e<vOd4_9i;^C`9w;a3p:a<j9]5 7Ke:_<3 9`5_Ga4h9t8_9^>e3]H^Eg5zAe4cZ_;ePGm2 3a3".replace(/./g,c=>c.repeat((n=c[C='charCodeAt']())<92||n-91))[C](parseInt(s.replace(/\W|\d/g,''),36)*79%2777%2328)*2-96,2),36)>>i&1)

전체 테스트 스위트 (Node.js)

온라인으로 사용해보십시오!

데모 (Chrome)

주의 : parseInt()브라우저 간 구현에 불일치가 있기 때문에 (1) Chrome의 모든 스테이션에서만 작동합니다.

(1) 사양에서 : mathInt는 Z로 기수 -R 표기법 [...]으로 표시되는 수학적 정수 값으로합니다. R이 2, 4, 8, 10, 16 또는 32가 아닌 경우 mathInt는 기수 -R 표기법으로 Z로 표시되는 수학 정수 값에 대한 구현 종속 근사값 일 수 있습니다 .


방법?

아래는 입력에 대한 단계별 디코딩 예입니다 s = "St. James's Park".

1 단계

먼저 모든 패딩 문자를 확장하여 기본 조회 테이블을 503에서 2,328 바이트로 늘립니다. 이 문자는 92보다 큰 ASCII 코드로 인코딩되는 반면 페이로드 데이터는 48-90 범위를 사용합니다.

tbl = " 5Kd5_9 5c4[...]"
  .replace(
    /./g, c =>
      c.repeat((n = c.charCodeAt()) < 92 || n - 91)
  )

2 단계

입력 문자열에서 알파벳이 아닌 문자를 모두 제거합니다.

str = s.replace(/\W|\d/g, '')

을 제공합니다 "StJamessPark".

3 단계

결과 문자열을 기본 36 수량으로 구문 분석합니다.

id = parseInt(str, 36)

이것은 3793395908848905700( Chrome V8에서 반환 한 대략의 결과입니다 )를 제공합니다.

4 단계

해시 값을 계산합니다.

hash = id * 79 % 2777 % 2328

을 제공합니다 533.

NB : 정밀도 손실로 인해이 결과는 수학적으로 정확하지 않습니다 (그렇습니다 184). 그러나 룩업 테이블은 물론 동일한 방식으로 구축되었으므로 우리가 기대하는 것입니다.

5 단계

기본 조회 테이블에서이 위치에있는 문자의 ASCII 코드를 검색합니다.

code = tbl.charCodeAt(hash)

제공되는 58(이는 문자이다 ':').

6 단계

이 값을 사용하여 보조 조회 테이블에서 2 자 문자열을 추출합니다.

msk36 = '7c1w0o74[...]'.substr(code * 2 - 96, 2)

을 제공합니다 0c.

7 단계

이 문자열을 기본 36 수량으로 구문 분석합니다.

msk = parseInt(msk36, 36)

을 제공합니다 12.

8 단계

마지막으로, msk가장 중요하지 않은 것으로 시작 하여 비트 세트에 따라 스테이션 목록을 필터링합니다 .

"Bakerloo,Central,Circle,District,[...]".split`,`.filter((_, i) => msk >> i & 1)

이 예에서, msk유지 12인, 00000001100진. 따라서 우리는 3, 4 번째 스테이션을 유지하여 최종 결과를 얻습니다 [ 'Circle', 'District' ].


@JonathanAllan 그렇지 않습니까? 나를 위해 그것을 반환합니다 Northern.
Outgolfer Erik

RegPack을 사용하여 스크립트를 압축하여 3 바이트를 절약 할 수 있습니다 .

@ThePirateBay (업데이트) 주 데이터 문자열을 다시 인코딩하여 46 바이트를 절약 했으므로 더 이상 RegPack 친화적이지 않습니다.
Arnauld

관심이 없다면, 당신이 말하는 불일치가 무엇입니까?
Neil

1
@Neil 명세서에서 : 하자 mathInt가 기수 R 표기 Z로 표현되는 수학 정수 값일 [...]. R이 2, 4, 8, 10, 16 또는 32가 아닌 경우 mathInt는 기수 -R 표기법으로 Z로 표시되는 수학 정수 값에 대한 구현 종속 근사값 일 수 있습니다 .
Arnauld

5

Kotlin , 2271 2270 2000 1694 바이트

{x->val r=java.util.Base64.getDecoder().decode("eJw1VcluG0cU/BWfchoC/dbuPpJDkTM2EuSUnGmFgIlQYkAzBwNEvj1VrUSHkXp7S1W90v7y/XG/vD6ev15eX09/XK7XH8/5cn+9np8/nx/321+36+Vxen8up7e38/372+Xx7dNPn+bL48fzl9v98e18f3/uTn+e79fb7fn576+X6/n8nM/vj/vp+vz99BgH/7/4DYlu98vpH83i290k0vq8nzbqptuXSa3GDiurbT+JRztMKpUf0R1OJXdTtnKcX5b9pKXgpOZ6+Dxtsuf8sp/MEGWjEm3FURSmcI15O0npvmWiKofJsyx447FyR43nKvYFqyzrMmkIUieTilZHSWHOyJKdz0vFVamNJUvKih0/YKfpKN9RsnRfpm4LWqyJb6uKLBuxjtXGiqJr6YFobLeujOfliGV0Nh8dYcOCb9KEGJnmYWoNmTIISiorE5eRuzZlLLWOTQu8qK1tJ9XM8dUVNfWO5sR0JRQ1ScFGo/Xx24yoZesMJzH6tdJ5Nb3vmas3Y+Iex5nHJhUVS5XKMqtxG2svhYGA9Bdk64XMqBQj2qU3LpGtoJtNV1u4Kt53hL8lam7BYpsDMfInLEhrj/ll6sR/g1gMJmo+gkk6MloujBHRtuNKR5AUFIogNYLvPJP3ypF9xnEyD5TW2Jo0cCcZMr5g3itwlRIDDlNH6E5irTmYbN2JiIesu6lmjHLaiORVWQDYJRNDPlpMRpIsu8FVw2M0CzAhvyOCCrkikRresZFppM0r1SK8gl4Wihow7A9oFKSw4t6IC6lJPiuoRD1y7GUtB+ZTUc6DDL1H2PpBAdS8sDkOEdVbEQGBMjhrBcihgHGk0OSRnPW2Dllo16E5Slobs+3JezWSAaaGqttoRyG5WsiFilMWSUCMSsTwB+uI6ojuzZCX1eGgyKC10wZq3ZOusv43QOwoGoYfMs/BLX2ilX5cqTetQ5xaGm6COIyQVMU0SSnliBQlOelmZT+1xE1Ahz+lqw/dBFsVVaC9aYbJNAcV8B7yjWahNMekkmgYDLzEhoFRgVI+yMCoDoITvaDTMTphOoSgA7ToIFbHSAh1j9nhn70630MCtKTGMbACOsKSegHQW2KUkG7PD9OoAFuUVTXHGGoRtJ0C9/EmCAKVLBxJGc7opWMooS5QbfCBhUmdkIK84V3FuYffo8wykmTHEGAg+XX43fC6RhNshUY5WrIwXhJBiSbUuduwXKuUcqdHELHhGzEw8cBUpbR5SwxKxSqcTCEUHVYDwvemx4UeH07TtKFSaEZgHKjTqCmFx/U6DLAq/gcs7EQaZ4cKElpgaUPk1ohw7Rhi3sIPB8Y6hTBgA7Ve6buBVgBSxXyH4RHm1RkCW4d/AeEEm1Q=")
var I=java.util.zip.Inflater()
I.setInput(r)
I.finished()
var o=ByteArray(1846)
I.inflate(o)
var v=String(o).split("~")
Regex("(-?[0-9]+)([A-Z]+)").findAll(v[1]).filter{x.hashCode()%2897==it.groupValues[1].toInt()}.map{it.groupValues[2].map{v[0].split("|")[it-'A']}}.first()}

미화

{x->
    // Parses the data line into groups of <hashcode % 2897, and line numbers within the list below as letters
    val r = java.util.Base64.getDecoder().decode("eJw1VcluG0cU/BWfchoC/dbuPpJDkTM2EuSUnGmFgIlQYkAzBwNEvj1VrUSHkXp7S1W90v7y/XG/vD6ev15eX09/XK7XH8/5cn+9np8/nx/321+36+Vxen8up7e38/372+Xx7dNPn+bL48fzl9v98e18f3/uTn+e79fb7fn576+X6/n8nM/vj/vp+vz99BgH/7/4DYlu98vpH83i290k0vq8nzbqptuXSa3GDiurbT+JRztMKpUf0R1OJXdTtnKcX5b9pKXgpOZ6+Dxtsuf8sp/MEGWjEm3FURSmcI15O0npvmWiKofJsyx447FyR43nKvYFqyzrMmkIUieTilZHSWHOyJKdz0vFVamNJUvKih0/YKfpKN9RsnRfpm4LWqyJb6uKLBuxjtXGiqJr6YFobLeujOfliGV0Nh8dYcOCb9KEGJnmYWoNmTIISiorE5eRuzZlLLWOTQu8qK1tJ9XM8dUVNfWO5sR0JRQ1ScFGo/Xx24yoZesMJzH6tdJ5Nb3vmas3Y+Iex5nHJhUVS5XKMqtxG2svhYGA9Bdk64XMqBQj2qU3LpGtoJtNV1u4Kt53hL8lam7BYpsDMfInLEhrj/ll6sR/g1gMJmo+gkk6MloujBHRtuNKR5AUFIogNYLvPJP3ypF9xnEyD5TW2Jo0cCcZMr5g3itwlRIDDlNH6E5irTmYbN2JiIesu6lmjHLaiORVWQDYJRNDPlpMRpIsu8FVw2M0CzAhvyOCCrkikRresZFppM0r1SK8gl4Wihow7A9oFKSw4t6IC6lJPiuoRD1y7GUtB+ZTUc6DDL1H2PpBAdS8sDkOEdVbEQGBMjhrBcihgHGk0OSRnPW2Dllo16E5Slobs+3JezWSAaaGqttoRyG5WsiFilMWSUCMSsTwB+uI6ojuzZCX1eGgyKC10wZq3ZOusv43QOwoGoYfMs/BLX2ilX5cqTetQ5xaGm6COIyQVMU0SSnliBQlOelmZT+1xE1Ahz+lqw/dBFsVVaC9aYbJNAcV8B7yjWahNMekkmgYDLzEhoFRgVI+yMCoDoITvaDTMTphOoSgA7ToIFbHSAh1j9nhn70630MCtKTGMbACOsKSegHQW2KUkG7PD9OoAFuUVTXHGGoRtJ0C9/EmCAKVLBxJGc7opWMooS5QbfCBhUmdkIK84V3FuYffo8wykmTHEGAg+XX43fC6RhNshUY5WrIwXhJBiSbUuduwXKuUcqdHELHhGzEw8cBUpbR5SwxKxSqcTCEUHVYDwvemx4UeH07TtKFSaEZgHKjTqCmFx/U6DLAq/gcs7EQaZ4cKElpgaUPk1ohw7Rhi3sIPB8Y6hTBgA7Ve6buBVgBSxXyH4RHm1RkCW4d/AeEEm1Q=")
    var I = java.util.zip.Inflater()
    I.setInput(r)
    I.finished()
    var o = ByteArray(1846)
    I.inflate(o)
    var v= String(o).split("~")
    Regex("(-?[0-9]+)([A-Z]+)")
            // Finds all the groups
            .findAll(v[1])// Gets the right group
            .filter{ x.hashCode()%2897==it.groupValues[1].toInt()}
            // Gets each letter and turns it into a station name
            .map{
                it.groupValues[2].map{
                    v[0]
                            .split("|")[it-'A']}}.first()
}

테스트

var v:(String)->List<String> =
{x->val r=java.util.Base64.getDecoder().decode("eJw1VcluG0cU/BWfchoC/dbuPpJDkTM2EuSUnGmFgIlQYkAzBwNEvj1VrUSHkXp7S1W90v7y/XG/vD6ev15eX09/XK7XH8/5cn+9np8/nx/321+36+Vxen8up7e38/372+Xx7dNPn+bL48fzl9v98e18f3/uTn+e79fb7fn576+X6/n8nM/vj/vp+vz99BgH/7/4DYlu98vpH83i290k0vq8nzbqptuXSa3GDiurbT+JRztMKpUf0R1OJXdTtnKcX5b9pKXgpOZ6+Dxtsuf8sp/MEGWjEm3FURSmcI15O0npvmWiKofJsyx447FyR43nKvYFqyzrMmkIUieTilZHSWHOyJKdz0vFVamNJUvKih0/YKfpKN9RsnRfpm4LWqyJb6uKLBuxjtXGiqJr6YFobLeujOfliGV0Nh8dYcOCb9KEGJnmYWoNmTIISiorE5eRuzZlLLWOTQu8qK1tJ9XM8dUVNfWO5sR0JRQ1ScFGo/Xx24yoZesMJzH6tdJ5Nb3vmas3Y+Iex5nHJhUVS5XKMqtxG2svhYGA9Bdk64XMqBQj2qU3LpGtoJtNV1u4Kt53hL8lam7BYpsDMfInLEhrj/ll6sR/g1gMJmo+gkk6MloujBHRtuNKR5AUFIogNYLvPJP3ypF9xnEyD5TW2Jo0cCcZMr5g3itwlRIDDlNH6E5irTmYbN2JiIesu6lmjHLaiORVWQDYJRNDPlpMRpIsu8FVw2M0CzAhvyOCCrkikRresZFppM0r1SK8gl4Wihow7A9oFKSw4t6IC6lJPiuoRD1y7GUtB+ZTUc6DDL1H2PpBAdS8sDkOEdVbEQGBMjhrBcihgHGk0OSRnPW2Dllo16E5Slobs+3JezWSAaaGqttoRyG5WsiFilMWSUCMSsTwB+uI6ojuzZCX1eGgyKC10wZq3ZOusv43QOwoGoYfMs/BLX2ilX5cqTetQ5xaGm6COIyQVMU0SSnliBQlOelmZT+1xE1Ahz+lqw/dBFsVVaC9aYbJNAcV8B7yjWahNMekkmgYDLzEhoFRgVI+yMCoDoITvaDTMTphOoSgA7ToIFbHSAh1j9nhn70630MCtKTGMbACOsKSegHQW2KUkG7PD9OoAFuUVTXHGGoRtJ0C9/EmCAKVLBxJGc7opWMooS5QbfCBhUmdkIK84V3FuYffo8wykmTHEGAg+XX43fC6RhNshUY5WrIwXhJBiSbUuduwXKuUcqdHELHhGzEw8cBUpbR5SwxKxSqcTCEUHVYDwvemx4UeH07TtKFSaEZgHKjTqCmFx/U6DLAq/gcs7EQaZ4cKElpgaUPk1ohw7Rhi3sIPB8Y6hTBgA7Ve6buBVgBSxXyH4RHm1RkCW4d/AeEEm1Q=")
var I=java.util.zip.Inflater()
I.setInput(r)
I.finished()
var o=ByteArray(1846)
I.inflate(o)
var v=String(o).split("~")
Regex("(-?[0-9]+)([A-Z]+)").findAll(v[1]).filter{x.hashCode()%2897==it.groupValues[1].toInt()}.map{it.groupValues[2].map{v[0].split("|")[it-'A']}}.first()}
data class TestData(val name: String, val lines: List<String>)

fun main(args: Array<String>) {
    var items = listOf(
            TestData("Acton Town", listOf("District", "Piccadilly")),
            TestData("Aldgate", listOf("Circle", "Metropolitan")),
            TestData("Aldgate East", listOf("District", "Hammersmith & City")),
            TestData("Alperton", listOf("Piccadilly")),
            TestData("Amersham", listOf("Metropolitan")),
            TestData("Angel", listOf("Northern")),
            TestData("Archway", listOf("Northern")),
            TestData("Arnos Grove", listOf("Piccadilly")),
            TestData("Arsenal", listOf("Piccadilly")),
            TestData("Baker Street", listOf("Bakerloo", "Circle", "Hammersmith & City", "Jubilee", "Metropolitan")),
            TestData("Balham", listOf("Northern")),
            TestData("Bank", listOf("Central", "Northern", "Waterloo & City")),
            TestData("Barbican", listOf("Circle", "Hammersmith & City", "Metropolitan")),
            TestData("Barking", listOf("District", "Hammersmith & City")),
            TestData("Barkingside", listOf("Central")),
            TestData("Barons Court", listOf("District", "Piccadilly")),
            TestData("Bayswater", listOf("Circle", "District")),
            TestData("Becontree", listOf("District")),
            TestData("Belsize Park", listOf("Northern")),
            TestData("Bermondsey", listOf("Jubilee")),
            TestData("Bethnal Green", listOf("Central")),
            TestData("Blackfriars", listOf("Circle", "District")),
            TestData("Blackhorse Road", listOf("Victoria")),
            TestData("Bond Street", listOf("Central", "Jubilee")),
            TestData("Borough", listOf("Northern")),
            TestData("Boston Manor", listOf("Piccadilly")),
            TestData("Bounds Green", listOf("Piccadilly")),
            TestData("Bow Road", listOf("District", "Hammersmith & City")),
            TestData("Brent Cross", listOf("Northern")),
            TestData("Brixton", listOf("Victoria")),
            TestData("Bromley-by-Bow", listOf("District", "Hammersmith & City")),
            TestData("Buckhurst Hill", listOf("Central")),
            TestData("Burnt Oak", listOf("Northern")),
            TestData("Caledonian Road", listOf("Piccadilly")),
            TestData("Camden Town", listOf("Northern")),
            TestData("Canada Water", listOf("Jubilee")),
            TestData("Canary Wharf", listOf("Jubilee")),
            TestData("Canning Town", listOf("Jubilee")),
            TestData("Cannon Street", listOf("Circle", "District")),
            TestData("Canons Park", listOf("Jubilee")),
            TestData("Chalfont & Latimer", listOf("Metropolitan")),
            TestData("Chalk Farm", listOf("Northern")),
            TestData("Chancery Lane", listOf("Central")),
            TestData("Charing Cross", listOf("Bakerloo", "Northern")),
            TestData("Chesham", listOf("Metropolitan")),
            TestData("Chigwell", listOf("Central")),
            TestData("Chiswick Park", listOf("District")),
            TestData("Chorleywood", listOf("Metropolitan")),
            TestData("Clapham Common", listOf("Northern")),
            TestData("Clapham North", listOf("Northern")),
            TestData("Clapham South", listOf("Northern")),
            TestData("Cockfosters", listOf("Piccadilly")),
            TestData("Colindale", listOf("Northern")),
            TestData("Colliers Wood", listOf("Northern")),
            TestData("Covent Garden", listOf("Piccadilly")),
            TestData("Croxley", listOf("Metropolitan")),
            TestData("Dagenham East", listOf("District")),
            TestData("Dagenham Heathway", listOf("District")),
            TestData("Debden", listOf("Central")),
            TestData("Dollis Hill", listOf("Jubilee")),
            TestData("Ealing Broadway", listOf("Central", "District")),
            TestData("Ealing Common", listOf("District", "Piccadilly")),
            TestData("Earl's Court", listOf("District", "Piccadilly")),
            TestData("East Acton", listOf("Central")),
            TestData("East Finchley", listOf("Northern")),
            TestData("East Ham", listOf("District", "Hammersmith & City")),
            TestData("East Putney", listOf("District")),
            TestData("Eastcote", listOf("Metropolitan", "Piccadilly")),
            TestData("Edgware", listOf("Northern")),
            TestData("Edgware Road", listOf("Bakerloo", "Circle", "District", "Hammersmith & City")),
            TestData("Elephant & Castle", listOf("Bakerloo", "Northern")),
            TestData("Elm Park", listOf("District")),
            TestData("Embankment", listOf("Bakerloo", "Circle", "District", "Northern")),
            TestData("Epping", listOf("Central")),
            TestData("Euston", listOf("Northern", "Victoria")),
            TestData("Euston Square", listOf("Circle", "Hammersmith & City", "Metropolitan")),
            TestData("Fairlop", listOf("Central")),
            TestData("Farringdon", listOf("Circle", "Hammersmith & City", "Metropolitan")),
            TestData("Finchley Central", listOf("Northern")),
            TestData("Finchley Road", listOf("Jubilee", "Metropolitan")),
            TestData("Finsbury Park", listOf("Piccadilly", "Victoria")),
            TestData("Fulham Broadway", listOf("District")),
            TestData("Gants Hill", listOf("Central")),
            TestData("Gloucester Road", listOf("Circle", "District", "Piccadilly")),
            TestData("Golders Green", listOf("Northern")),
            TestData("Goldhawk Road", listOf("Circle", "Hammersmith & City")),
            TestData("Goodge Street", listOf("Northern")),
            TestData("Grange Hill", listOf("Central")),
            TestData("Great Portland Street", listOf("Circle", "Hammersmith & City", "Metropolitan")),
            TestData("Greenford", listOf("Central")),
            TestData("Green Park", listOf("Jubilee", "Piccadilly", "Victoria")),
            TestData("Gunnersbury", listOf("District")),
            TestData("Hainault", listOf("Central")),
            TestData("Hammersmith", listOf("Circle", "District", "Hammersmith & City", "Piccadilly")),
            TestData("Hampstead", listOf("Northern")),
            TestData("Hanger Lane", listOf("Central")),
            TestData("Harlesden", listOf("Bakerloo")),
            TestData("Harrow & Wealdstone", listOf("Bakerloo")),
            TestData("Harrow-on-the-Hill", listOf("Metropolitan")),
            TestData("Hatton Cross", listOf("Piccadilly")),
            TestData("Heathrow Terminals 1, 2, 3", listOf("Piccadilly")),
            TestData("Heathrow Terminal 4", listOf("Piccadilly")),
            TestData("Heathrow Terminal 5", listOf("Piccadilly")),
            TestData("Hendon Central", listOf("Northern")),
            TestData("High Barnet", listOf("Northern")),
            TestData("Highbury & Islington", listOf("Victoria")),
            TestData("Highgate", listOf("Northern")),
            TestData("High Street Kensington", listOf("Circle", "District")),
            TestData("Hillingdon", listOf("Metropolitan", "Piccadilly")),
            TestData("Holborn", listOf("Central", "Piccadilly")),
            TestData("Holland Park", listOf("Central")),
            TestData("Holloway Road", listOf("Piccadilly")),
            TestData("Hornchurch", listOf("District")),
            TestData("Hounslow Central", listOf("Piccadilly")),
            TestData("Hounslow East", listOf("Piccadilly")),
            TestData("Hounslow West", listOf("Piccadilly")),
            TestData("Hyde Park Corner", listOf("Piccadilly")),
            TestData("Ickenham", listOf("Metropolitan", "Piccadilly")),
            TestData("Kennington", listOf("Northern")),
            TestData("Kensal Green", listOf("Bakerloo")),
            TestData("Kensington (Olympia)", listOf("District")),
            TestData("Kentish Town", listOf("Northern")),
            TestData("Kenton", listOf("Bakerloo")),
            TestData("Kew Gardens", listOf("District")),
            TestData("Kilburn", listOf("Jubilee")),
            TestData("Kilburn Park", listOf("Bakerloo")),
            TestData("Kingsbury", listOf("Jubilee")),
            TestData("King's Cross St. Pancras", listOf("Circle", "Hammersmith & City", "Metropolitan", "Northern", "Piccadilly", "Victoria")),
            TestData("Knightsbridge", listOf("Piccadilly")),
            TestData("Ladbroke Grove", listOf("Circle", "Hammersmith & City")),
            TestData("Lambeth North", listOf("Bakerloo")),
            TestData("Lancaster Gate", listOf("Central")),
            TestData("Latimer Road", listOf("Circle", "Hammersmith & City")),
            TestData("Leicester Square", listOf("Northern", "Piccadilly")),
            TestData("Leyton", listOf("Central")),
            TestData("Leytonstone", listOf("Central")),
            TestData("Liverpool Street", listOf("Central", "Circle", "Hammersmith & City", "Metropolitan")),
            TestData("London Bridge", listOf("Jubilee", "Northern")),
            TestData("Loughton", listOf("Central")),
            TestData("Maida Vale", listOf("Bakerloo")),
            TestData("Manor House", listOf("Piccadilly")),
            TestData("Mansion House", listOf("Circle", "District")),
            TestData("Marble Arch", listOf("Central")),
            TestData("Marylebone", listOf("Bakerloo")),
            TestData("Mile End", listOf("Central", "District", "Hammersmith & City")),
            TestData("Mill Hill East", listOf("Northern")),
            TestData("Monument", listOf("Circle", "District")),
            TestData("Moorgate", listOf("Circle", "Hammersmith & City", "Metropolitan", "Northern")),
            TestData("Moor Park", listOf("Metropolitan")),
            TestData("Morden", listOf("Northern")),
            TestData("Mornington Crescent", listOf("Northern")),
            TestData("Neasden", listOf("Jubilee")),
            TestData("Newbury Park", listOf("Central")),
            TestData("North Acton", listOf("Central")),
            TestData("North Ealing", listOf("Piccadilly")),
            TestData("North Greenwich", listOf("Jubilee")),
            TestData("North Harrow", listOf("Metropolitan")),
            TestData("North Wembley", listOf("Bakerloo")),
            TestData("Northfields", listOf("Piccadilly")),
            TestData("Northolt", listOf("Central")),
            TestData("Northwick Park", listOf("Metropolitan")),
            TestData("Northwood", listOf("Metropolitan")),
            TestData("Northwood Hills", listOf("Metropolitan")),
            TestData("Notting Hill Gate", listOf("Central", "Circle", "District")),
            TestData("Oakwood", listOf("Piccadilly")),
            TestData("Old Street", listOf("Northern")),
            TestData("Osterley", listOf("Piccadilly")),
            TestData("Oval", listOf("Northern")),
            TestData("Oxford Circus", listOf("Bakerloo", "Central", "Victoria")),
            TestData("Paddington", listOf("Bakerloo", "Circle", "District", "Hammersmith & City")),
            TestData("Park Royal", listOf("Piccadilly")),
            TestData("Parsons Green", listOf("District")),
            TestData("Perivale", listOf("Central")),
            TestData("Piccadilly Circus", listOf("Bakerloo", "Piccadilly")),
            TestData("Pimlico", listOf("Victoria")),
            TestData("Pinner", listOf("Metropolitan")),
            TestData("Plaistow", listOf("District", "Hammersmith & City")),
            TestData("Preston Road", listOf("Metropolitan")),
            TestData("Putney Bridge", listOf("District")),
            TestData("Queen's Park", listOf("Bakerloo")),
            TestData("Queensbury", listOf("Jubilee")),
            TestData("Queensway", listOf("Central")),
            TestData("Ravenscourt Park", listOf("District")),
            TestData("Rayners Lane", listOf("Metropolitan", "Piccadilly")),
            TestData("Redbridge", listOf("Central")),
            TestData("Regent's Park", listOf("Bakerloo")),
            TestData("Richmond", listOf("District")),
            TestData("Rickmansworth", listOf("Metropolitan")),
            TestData("Roding Valley", listOf("Central")),
            TestData("Royal Oak", listOf("Circle", "Hammersmith & City")),
            TestData("Ruislip", listOf("Metropolitan", "Piccadilly")),
            TestData("Ruislip Gardens", listOf("Central")),
            TestData("Ruislip Manor", listOf("Metropolitan", "Piccadilly")),
            TestData("Russell Square", listOf("Piccadilly")),
            TestData("St. James's Park", listOf("Circle", "District")),
            TestData("St. John's Wood", listOf("Jubilee")),
            TestData("St. Paul's", listOf("Central")),
            TestData("Seven Sisters", listOf("Victoria")),
            TestData("Shepherd's Bush", listOf("Central")),
            TestData("Shepherd's Bush Market", listOf("Circle", "Hammersmith & City")),
            TestData("Sloane Square", listOf("Circle", "District")),
            TestData("Snaresbrook", listOf("Central")),
            TestData("South Ealing", listOf("Piccadilly")),
            TestData("South Harrow", listOf("Piccadilly")),
            TestData("South Kensington", listOf("Circle", "District", "Piccadilly")),
            TestData("South Kenton", listOf("Bakerloo")),
            TestData("South Ruislip", listOf("Central")),
            TestData("South Wimbledon", listOf("Northern")),
            TestData("South Woodford", listOf("Central")),
            TestData("Southfields", listOf("District")),
            TestData("Southgate", listOf("Piccadilly")),
            TestData("Southwark", listOf("Jubilee")),
            TestData("Stamford Brook", listOf("District")),
            TestData("Stanmore", listOf("Jubilee")),
            TestData("Stepney Green", listOf("District", "Hammersmith & City")),
            TestData("Stockwell", listOf("Northern", "Victoria")),
            TestData("Stonebridge Park", listOf("Bakerloo")),
            TestData("Stratford", listOf("Central", "Jubilee")),
            TestData("Sudbury Hill", listOf("Piccadilly")),
            TestData("Sudbury Town", listOf("Piccadilly")),
            TestData("Swiss Cottage", listOf("Jubilee")),
            TestData("Temple", listOf("Circle", "District")),
            TestData("Theydon Bois", listOf("Central")),
            TestData("Tooting Bec", listOf("Northern")),
            TestData("Tooting Broadway", listOf("Northern")),
            TestData("Tottenham Court Road", listOf("Central", "Northern")),
            TestData("Tottenham Hale", listOf("Victoria")),
            TestData("Totteridge & Whetstone", listOf("Northern")),
            TestData("Tower Hill", listOf("Circle", "District")),
            TestData("Tufnell Park", listOf("Northern")),
            TestData("Turnham Green", listOf("District", "Piccadilly")),
            TestData("Turnpike Lane", listOf("Piccadilly")),
            TestData("Upminster", listOf("District")),
            TestData("Upminster Bridge", listOf("District")),
            TestData("Upney", listOf("District")),
            TestData("Upton Park", listOf("District", "Hammersmith & City")),
            TestData("Uxbridge", listOf("Metropolitan", "Piccadilly")),
            TestData("Vauxhall", listOf("Victoria")),
            TestData("Victoria", listOf("Circle", "District", "Victoria")),
            TestData("Walthamstow Central", listOf("Victoria")),
            TestData("Wanstead", listOf("Central")),
            TestData("Warren Street", listOf("Northern", "Victoria")),
            TestData("Warwick Avenue", listOf("Bakerloo")),
            TestData("Waterloo", listOf("Bakerloo", "Jubilee", "Northern", "Waterloo & City")),
            TestData("Watford", listOf("Metropolitan")),
            TestData("Wembley Central", listOf("Bakerloo")),
            TestData("Wembley Park", listOf("Jubilee", "Metropolitan")),
            TestData("West Acton", listOf("Central")),
            TestData("West Brompton", listOf("District")),
            TestData("West Finchley", listOf("Northern")),
            TestData("West Ham", listOf("District", "Hammersmith & City", "Jubilee")),
            TestData("West Hampstead", listOf("Jubilee")),
            TestData("West Harrow", listOf("Metropolitan")),
            TestData("West Kensington", listOf("District")),
            TestData("West Ruislip", listOf("Central")),
            TestData("Westbourne Park", listOf("Circle", "Hammersmith & City")),
            TestData("Westminster", listOf("Circle", "District", "Jubilee")),
            TestData("White City", listOf("Central")),
            TestData("Whitechapel", listOf("District", "Hammersmith & City")),
            TestData("Willesden Green", listOf("Jubilee")),
            TestData("Willesden Junction", listOf("Bakerloo")),
            TestData("Wimbledon", listOf("District")),
            TestData("Wimbledon Park", listOf("District")),
            TestData("Wood Green", listOf("Piccadilly")),
            TestData("Wood Lane", listOf("Circle", "Hammersmith & City")),
            TestData("Woodford", listOf("Central")),
            TestData("Woodside Park", listOf("Northern"))
    )

    var good = 0
    var bad = 0

    for (item in items) {
        var out = v(item.name);
        if (item.lines == out) {
            good++
        } else {
            bad++
        }
    }
    println("Results: G $good B $bad")
}

편집

불필요한 파이프 구분 기호 제거 -270 바이트

zip 도구로 압축 -306 바이트


1
TIL : Woodside Park는 1337입니다.
Jonathan Allan

조금 더 아래로 문자열을 압축하는 자바의 우편 도구를 사용하여 찾고, 바이트 수를 얻어야한다
jrtapsell

5

파이썬 2 , 2309 2301 2218 바이트

lambda I,p="Woods|Woodf|Wood L|Wo|Wimbledon |Wim|Willesden J|Wi|Whitec|Wh|Westm|Westb|West R|West K|West Har|West Hamp|West H|West F|West B|Wes|Wembley P|We|Watf|Wat|Warw|War|Wan|W|Vi|V|Ux|Upt|Upn|Upminster |U|Turnp|Tur|Tu|Tow|Totter|Tottenham H|Tot|Tooting Br|To|Th|T|Sw|Sudbury T|Su|Str|Ston|Sto|Ste|Stan|Sta|St. P|St. Jo|St|Southw|Southg|Southf|South Wo|South W|South R|South Kent|South K|South H|So|Sn|Sl|Shepherd's Bush |Sh|S|Rus|Ruislip M|Ruislip |Ru|Roy|Ro|Rick|Ri|Reg|Re|Ray|R|Queensw|Queens|Q|Pu|Pr|Pl|Pin|Pim|Pi|Pe|Pars|Par|P|Ox|Ov|Os|Ol|O|Not|Northwood |Northwo|Northw|Northo|Northf|North W|North H|North G|North E|No|New|N|Morn|Mor|Moorg|Moo|Mo|Mill|Mi|Mary|Mar|Mans|Man|M|Lou|Lo|Li|Leytons|Ley|Le|Lat|Lan|Lam|L|Kn|Kings|Kin|Kilburn |Ki|Kew|Kento|Kent|Kensi|Kens|K|I|Hy|Hounslow W|Hounslow E|Hou|Hor|Hollo|Holl|Ho|Hil|Highg|Highb|High S|Hi|Hen|Heathrow Terminals|Heathrow Terminal 5|He|Hat|Harrow-|Harr|Har|Han|Hamp|Ham|H|Gu|Greenf|Gree|Gre|Gr|Goo|Goldh|Go|Gl|G|Fu|Fins|Finchley R|Fi|Far|F|Euston |Eu|Ep|Em|Elm|El|Edgware |Ed|Eastc|East P|East H|East F|Eas|Ear|Ealing C|E|Do|De|Dagenham H|D|Cr|Cov|Coll|Col|Co|Clapham S|Clapham N|Cl|Cho|Chis|Chi|Che|Char|Chan|Chalk|Ch|Cano|Canno|Cann|Canar|Can|Cam|C|Bur|Bu|Bro|Bri|Br|Bow|Bou|Bos|Bor|Bo|Blackh|Bl|Bet|Ber|Bel|Be|Bay|Baro|Barkings|Bark|Bar|Ban|Bal|B|Ars|Arn|Ar|An|Am|Alp|Aldgate |Al|".split('|'):[j for i,j in enumerate('District|Piccadilly|Northern|Central|Circle|Metropolitan|Hammersmith & City|Jubilee|Bakerloo|Victoria|Waterloo & City'.split('|'))if[int(x,35)for x in'4 8 2A 2 1 1 7B 3N 1U 8 45 2A 8 1 W 3N 5I 4 1 8 4K 7B W 15C 7B EQ 8 EM F4 EM Y 1U 1 1 1 2 3 4 H 4 EM C 4 4 8 H 3N 2 2 3V 7B EQ 1U 3N 1 8 3N H 3N 2 1 8 4 8 7B J 2 2 8 H 2A 8 EM 2 Y 8 Y 2A 8 W 1 7B 8 Y 1 8 3N 7B 1 W 1U W EM 7D 8 1 2 9M M6 4 2 4 2 P W W W 8 2 7B W 3N 2 8 8 3N 4 4 3B W H 4 23 7B 8 H 2 7B 8 3R 3F 8 8 6 2A 8 7B 2A 2 3N I0 7B 3N 1 7B 4 1 7B 4 Y 2 2 2 2 1 2 8 A Y 4 EM H 4 4 2 2 2 2 W 7B 7B 8 4 2D 8 1 8 IC 37 8 4 2A 4 J 8 1 EO 4K 4 37 8 37 EQ 8 7W 1 7F 9M 4 Y 1 1U 4 8 3 3 9 3N 8 1 1 W 2 4 4 2 4 4 4 W 1 8 W 7F 8 4 W 3N H 3N 3N 3N 4 2 4 8 1U EM 4 1U 2 2 4 3V EM H 8 3N 4 1 H 3 8 1U 37 TL 4 E6 2 2 4 4 W 2 1U 1D 3'.split()][p.index([x for x in p if I.find(x)==0][0])]&2**i]

온라인으로 사용해보십시오!

Xcoder 씨 에게 -6 감사합니다 .

너무 길면 ... 아마 골프를 타는 것일 수도 있습니다.



1813 바이트 다른 조회 방법 사용. @mdahmoune의 인코딩을 사용하는 1498 바이트
TFeld

1498 바이트 @EriktheOutgolfer 어떻게 든 잘못된 링크를 복사했습니다. 여기 있습니다 ..
TFeld

1
중복을 제거하는 것을 잊었습니다 (유사한 이름과 같은 줄을 가진 여러 스테이션) : 1708 바이트1434 바이트
TFeld


3

계피 껌 , 2100 바이트

16 진 덤프 :

0000000: 6c95 594d 77db 3a0e fd2b 5ab9 33e7 3873  l.YMw.:..+Z.3.8s
0000010: ce7c ccaa ab3a 6d93 d797 be66 92bc 7a0d  .|...:m....f..z.
0000020: 4b88 c563 8af4 8054 1ccd af1f 1066 484a  K..c...T.....fHJ
0000030: 4aec 7417 5f80 e025 085c 92ca a7da 5b53  J.t._..%.\....[S
0000040: 3dd8 8359 7c56 ce93 aafd f256 d535 344a  =..Y|V.....V.54J
0000050: ebe1 e327 dd6c c1e3 e252 51ad 71f9 1d3d  ...'.l...RQ.q..=
0000060: d9bd d5ca 8379 b155 5fc0 f93c f81a ba0e  .....y.U_..<....
0000070: c975 cab7 1598 a6ba 543e 84d9 23f1 448b  .u......T>..#.D.
0000080: 3274 706b a15b 8c83 9a2d eac5 1f96 7c8b  2tpk.[...-....|.
0000090: c43f a96e 0f30 9480 b1ae ba22 fb84 a360  .?.n.0....."...`
00000a0: e4d0 802e a115 ec90 aa7b 4f88 7e21 3fb4  .........{O.~!?.
00000b0: b5cb b890 d758 2ebf f51b a571 b2ca 1568  .....X.....q...h
00000c0: 2699 09ac c0ec 1697 683c 815e bea0 cb35  &.......h<.^...5
00000d0: 7889 9f82 b11f 6d54 0d66 7162 c6e9 4cb4  x.....mT.fqb..L.
00000e0: 5366 7b26 95d1 cba9 065f 6804 cc1a 575d  Sf{&....._h...W]
00000f0: da9e 8a9d 18e5 6270 8740 f185 cd8b d3c7  ......bp.@......
0000100: 15d6 d684 1c2d 0a48 3bf5 3fac 6e79 a662  .....-.H;.?.ny.b
0000110: dd48 9d35 8dc3 6111 f3c4 906f 0d68 de0d  .H.5..a....o.h..
0000120: 4493 c968 a877 8fa4 80dc 6c36 b1b5 961c  D..h.w....l6....
0000130: 5677 169a c54f 062d bb7e 5c71 e8b8 5729  Vw...O.-.~\q..W)
0000140: b969 1a4b b6df b605 15eb 42d1 7e07 6369  .i.K......B.~.ci
0000150: b4e3 b667 8291 ce08 3fc8 74e7 324b 3c71  ...g....?.t.2K<q
0000160: 7549 d6b9 622e 52cf 3c59 c194 6ca7 71b8  uI..b.R.<Y..l.q.
0000170: d80c 171c f75c c89e 97db 93f3 d535 33c9  .....\.......53.
0000180: 29ea 8967 fa01 457a 2f41 6363 8d02 2354  )..g..Ez/Acc..#T
0000190: 0bfa 6cea 1a8c 3d5a f81b 68a0 92ba 4b1b  ..l...=Z..h...K.
00001a0: 1240 1aaa 750b f458 8286 0b46 c68f 406b  .@..u..X...F..@k
00001b0: 52c6 27db c456 6b9c 1440 1ed1 827e b44c  R.'..Vk..@...~.L
00001c0: 7b51 dd80 57bc d651 e38a 7d57 7d05 4abd  {Q..W..Q..}W}.J.
00001d0: 2298 a991 061e 6172 b532 4a81 9064 3a77  ".....ar.2J..d:w
00001e0: 6631 0a67 bac0 a0da 1eb0 c821 03ee a0ea  f1.g.......!....
00001f0: dd91 65a6 de5a d238 1cac 6d26 0134 ec39  ..e..Z.8..m&.4.9
0000200: 2a37 49d7 d994 c88c 0b30 87ef 6d3f 822d  *7I......0..m?.-
0000210: d7b6 751e c98d b688 2731 0d68 2c3d b556  ..u.....'1.h,=.V
0000220: ec56 ad99 4a09 3f85 2abb 026a c645 cad9  .V..J.?.*..j.E..
0000230: 7866 e263 d29f 618b 8669 8c35 36c3 d708  xf.c..a..i.56...
0000240: 5ef4 319b 70d3 14cd f839 b070 527d 6927  ^.1.p....9.pR}i'
0000250: bf80 0ee9 e742 8626 8c8d be79 fba3 43cc  .....B.&...y..C.
0000260: d42b 7ac2 1ea4 3f9c 129c c0b7 92b3 2551  .+z...?.......%Q
0000270: 11e8 ab32 75ab b110 7481 b979 ce74 92b8  ...2u...t..y.t..
0000280: ddf6 de60 5eac 80b5 f538 4ada 8846 b33d  ...`^....8J..F.=
0000290: 0015 bb12 01e9 b1d9 a170 8681 46ae 0869  .........p..F..i
00002a0: 804b 9e57 e3bc 74d9 a79b d4e3 976e 0366  .K.W..t......n.f
00002b0: d7a1 f16f 4f97 87ef f79c f89c b1de f9a2  ...oO...........
00002c0: 5497 4983 c4c0 ddfb df1e 08df 7fc0 7c05  T.I...........|.
00002d0: c5f3 ef53 7c6e d6d0 888d 35bf 1023 6e60  ...S|n....5..#n`
00002e0: 1583 2476 d922 b98d c536 1bec 363d 0d92  ..$v."...6..6=..
00002f0: a3a2 f8f3 cabe f6e1 b4cd b599 f278 05c6  .............x..
0000300: bbb1 8a5e 69db d718 7a51 a6cc 2a36 2fc7  ...^i...zQ..*6/.
0000310: 2bab 1ba4 7834 24ca 02b7 70d8 c9f8 5339  +...x4$...p...S9
0000320: 604f db6c 31ea 6511 80c0 303c a645 085c  `O.l1.e...0<.E.\
0000330: aaec a221 1f6a ef4e b050 7cb4 d494 01d1  ...!.j.N.P|.....
0000340: 8cc4 78f9 5aea ae7a 6390 24bf 396d d7a0  ..x.Z..zc.$.9m..
0000350: 0cf4 daa7 6005 81c5 7bca becc 22db f7ce  ....`...{..."...
0000360: 2314 7276 1dd6 4f23 7d67 8c34 ba06 4daa  #.rv..O#}g.4..M.
0000370: f800 913d 70e7 ac11 7413 8a17 a7c6 0b6b  ...=p...t......k
0000380: 2e38 e685 e4b2 cc08 db3d 0f88 c745 4147  .8.......=...EAG
0000390: c42f 847d 40ea 9401 edaa bf2f ab7f 2cab  ./.}@....../..,.
00003a0: 7f9e f4aa fe75 dafc efb1 d934 d6cc 8bfd  .....u.....4....
00003b0: 5a6d db6a 0564 d08f 4129 ef45 f59b 0b12  Zm.j.d..A).E....
00003c0: 5a5e 1cc4 2a77 e991 7fac 8fea 7734 2e8e  Z^..*w......w4..
00003d0: 989e c621 23b1 4ddf d2b9 6bab 3796 92d6  ...!#.M...k.7...
00003e0: 4e4c 5287 523f d12e a03d 40ec d591 3771  NLR.R?...=@...7q
00003f0: 17f7 54b7 450d d9de 3876 4f59 c8fe d916  ..T.E...8vOY....
0000400: a4f8 55c3 1a27 86a1 4121 c3a7 0719 a4d2  ..U..'..A!......
0000410: f65b bd93 73ed cd75 7296 4ccc 52ca 2263  .[..s..ur.L.R."c
0000420: 2e5d 4253 51e5 7c56 7ff9 a187 6eaf e0af  .]BSQ.|V....n...
0000430: 7949 6cf5 cab5 e33b 95a0 7614 e310 0f6a  yIl....;..v....j
0000440: 570c 559a f738 dfa4 e26f 5952 3194 e796  W.U..8...oYR1...
0000450: 56cc 7e8c 7c70 c72a e64d ff1b 0f30 3581  V.~.|p.*.M...05.
0000460: 7bb7 32a4 63e2 d5ee ffdd 7031 79b7 21c5  {.2.c.....p1y.!.
0000470: 3a55 e6f4 069a 0dd9 1dc6 37d3 89d9 d8b5  :U........7.....
0000480: db20 0332 515a 0bc3 a606 91d9 2bf0 b9cd  . .2QZ......+...
0000490: e32d f0bc 76de a08a 321d 0fac f942 82d3  .-..v...2....B..
00004a0: 505c 16e2 4f11 8a8c a927 a4bd b57a fa50  P\..O....'...z.P
00004b0: 78b7 b6de 58e9 e695 2429 8969 daff 9bf0  x...X...$).i....
00004c0: cc28 597c 07d5 40f5 1374 a156 f2ea a8b8  .(Y|..@..t.V....
00004d0: bc5d 99e6 003b 654d 344c 5a98 adb4 d158  .]...;eM4LZ....X
00004e0: 85d7 6c11 9c06 8d1b 6bca e08a bdbe 98a4  ..l.....k.......
00004f0: fda7 b539 b86b 397c a4fd 7221 7fb7 a697  ...9.k9|..r!....
0000500: 2bc7 8c87 b524 1af4 cb45 2743 8f45 5eda  +....$...E'C.E^.
0000510: 1996 8b6c e146 d2a1 22d8 e86a 3405 af3f  ...l.F.."..j4..?
0000520: 105c 83a9 77f8 f741 f472 a44d e25d dc1d  .\..w..A.r.M.]..
0000530: 3376 bc97 1659 8fb8 b4fe 41d5 6d0e 2cf8  3v...Y....A.m.,.
0000540: f160 19f1 8d96 3576 bc1f 434e bcc0 8f0a  .`....5v..CN....
0000550: 75e3 66f1 adf6 6322 f9d9 310f 3d7b 7864  u.f...c"..1.={xd
0000560: 5876 ca4d 8dde f39a c434 6aaf e574 ebf8  Xv.M.....4j..t..
0000570: b528 b10b 763f 7433 bb91 fc08 8d16 9656  .(..v?t3.......V
0000580: fa3d 812e 3c9e c3ed a20a f1fb e2f9 15e7  .=..<...........
0000590: cd8a 720b 4d13 b5f6 d72e ca22 ee77 7628  ..r.M......".wv(
00005a0: 4f0a 419d 35f1 0a96 e5f4 1649 31bd dce5  O.A.5......I1...
00005b0: 79c8 8c62 194d 755a d576 91d9 2a63 a64f  y..b.MuZ.v..*c.O
00005c0: d25b 0d3c cdd9 47fa 2d21 7bc5 77f7 3880  .[.<..G.-!{.w.8.
00005d0: bc37 a25e 64ce ffe9 11cd 0737 917c 4147  .7.^d......7.|AG
00005e0: 9a1f a1e2 8df5 f10e 9e18 a9c3 bb69 fc50  .............i.P
00005f0: 60cb 6098 9a5c a5de 3cff eeb0 890a 9f02  `.`..\..<.......
0000600: e216 8d9f 91b9 e36e e8ac 698a f85c b41d  .......n..i..\..
0000610: 301b 11f7 d132 ef6c d8e8 a073 1a33 55d9  0....2.l...s.3U.
0000620: 41f9 4871 4adc ef7a e5b4 dabf c138 d9d3  A.HqJ..z.....8..
0000630: 399a a247 5ce4 f4c4 68e7 50eb 9783 a3b0  9..G\...h.P.....
0000640: 8413 f41b 74e8 e2d2 6752 270e b6e5 7d92  ....t...gR'...}.
0000650: 1778 da93 e3d1 dbeb 0f99 cb3d f2a6 54f7  .x.........=..T.
0000660: 4a9e f5b9 a4ee 5bdc b748 0d47 58f5 2e0b  J.....[..H.GX...
0000670: f704 e725 d0ee e40d 9fd9 6a0b 06e3 32e6  ...%......j...2.
0000680: 540d a36e 43d6 eef2 24b6 7f55 f118 cfca  T..nC...$..U....
0000690: 36c5 4fdc 2297 aff9 96bd 1dd1 b82f 131e  6.O."......../..
00006a0: 6b15 f4b2 29af 5d62 90d4 0639 29fd 9390  k...).]b...9)...
00006b0: a605 0a28 e7ce 94c5 8173 576c 0d74 a24d  ...(.....sWl.t.M
00006c0: 2b49 45b1 9560 3a4b 5838 e2de e030 d192  +IE..`:KX8...0..
00006d0: 3752 ef6d bd93 2f47 f377 34db 0c1e 1b6a  7R.m../G.w4....j
00006e0: dc3f 6c21 f0e5 c296 69ee be09 3d2e 8a5d  .?l!....i...=..]
00006f0: 2c27 e172 a52c f183 72e1 4b89 f7b0 cd2b  ,'.r.,..r.K....+
0000700: 78c0 6eaf e795 f0d0 e220 3714 ab72 793e  x.n...... 7..ry>
0000710: 582b 67c4 0aeb 9cfe 08e6 9772 61f1 5e6e  X+g........ra.^n
0000720: d1c7 cf33 226b 6915 af78 5d83 c65c f482  ...3"ki..x]..\..
0000730: 4b46 c26b ad45 2f77 b032 fa01 4916 3f27  KF.k.E/w.2..I.?'
0000740: df3f 1ad4 7afc dd98 5192 6926 7b95 3324  .?..z...Q.i&{.3$
0000750: 1e7b b5c3 a3f4 1586 3ff7 9d32 a129 d3b0  .{......?..2.)..
0000760: 0c65 514e 1683 43f9 9379 0b95 33f5 f1e7  .eQN..C..y..3...
0000770: b314 c0db 9afb 13fa e716 b4ce 397a f963  ............9z.c
0000780: d663 c963 0dda f3a2 9d2f 5e4d 8531 ac20  .c.c...../^M.1. 
0000790: 6f0a 0344 68a6 4779 198d e4ca f189 65aa  o..Dh.Gy......e.
00007a0: 2f6e 8b2f ff74 48c8 4b91 9efa bfc4 5aea  /n./.tH.K.....Z.
00007b0: 7a72 d0c5 fb50 e29a a788 86d1 d787 c9d0  zr...P..........
00007c0: d997 3e81 b830 3bde 83bc e502 cf3f 000a  ..>..0;......?..
00007d0: 7cfe 0360 ea3f 71cf 5f22 c6f0 fcc2 2786  |..`.?q._"....'.
00007e0: ac8b 533a 13b9 1370 637b 3251 104e 88ba  ..S:...pc{2Q.N..
00007f0: f8c6 6a9c 5642 66db 2a8f e29e a610 a86e  ..j.VBf.*......n
0000800: 618f fa4c 69ae 953e 7e48 89cd 9382 26fc  a..Li..>~H....&.
0000810: 5b6f 6aaf 4a15 4f4a 9d62 6768 72e3 08da  [oj.J.OJ.bghr...
0000820: 3dff 6789 a0d2 8927 d73e d17d 019c 6a70  =.g....'.>.}..jp
0000830: d2fd ff07                                ....

온라인으로 사용해보십시오!

나는 이것이 훨씬 더 골프화 될 수 있다는 것을 의심하지 않는다 . 문제는 시나몬 껌의 완전한 문서가 부족하다는 것이다. (@quartata pls는 놀라운 트롤 언어 일 가능성이 큽니다) 소스 코드를 조사하여 이것에 도움이 될만한 것이 있는지 확인할 수 있습니다.

이것은 압축 문자열을 생성하기 위해 함께 해킹 한 Python 스크립트입니다.


3

PHP, 1785 1780 1471 바이트

eval(gzinflate(base64_decode('TZXLimRFEIZfZSiKoQsCyfuFpjfqQgTFlS7GQfJqF/Z0DdU1MCK+u1+0DrgpzjmZEfnfImt/eh638+X5Tbs79tNfx/Fw2Cv6IstEl2T07IOMWYp4G5OYELJsl7J0W4u0wI9zw7jAYo09Swze5iYtLheSpLWoryZZsbnS1njvvLia+Gkzy1w+irHGSuyBldFmlemCjWIX7agv0ucosounVa6GjyNXKdHw7tKyklrJUkcrUjL4bKY6lByljR0lbkPjBEQQ1iTFrixtVSu5LLqV1pPksa2MkL00t+C9GhSDnrViFpNDEZs2dRHQwTjwNPTZmdZzdsrKsBCFTR7RevGpKd1c9Ld51jqNspmAjsN4CdOkInkCPVkPxAClyIltDuACzXm4NNpuYyCc2lZJS8kw3kOfw1YqU8UvCFXBE4CCBeLCdCqdiuy3d3RXJrsiNU5otUnBSkstUjjZLT7ywTjFUiRYl/E/ssVkIx5AYmpOdO7grlbBryKRZUnTZnHZVWJSkbQW2oEXhnVvtvaxVAIqyZUnJbrScpGUsc1XBDV787F4KA1rDCvIWDONTetG9ogg1GCUZo3kMKJ0oynL4McRdajBc+xkpG9VKQXes8+cs6ZDFLCIWcYq/dmbChK7lR45b3hwBlMV+aI6Z2fE1mVxBtsg2dRtn5KeKXGhRdyvmkKZ6ESZjWY+oNl4PXOTQbcm8aqKyXjFiDnBNGoduWuLFDnCSOe9kXMuZPdwkvgaNeS10Bv934RsBs6USkAafKxJpgA8VKmFbnbquAITc+OkY8O0bFDKVvKe1va0sCpzhuFmmmSM4iUnQo+WlpSQLFzUTbknLVIXXdr6PoCZG6xWatSHzhym101ZlR86aWtbkBUYkE4I26RBJO1Yagop2ASmbuATH9oNwjZc1cHxDFOcaJZ01oPTOV9hY75vGJ97JEkdJC4w2Na83hiGCUmFu8I1hnbkQWKKStJiUik12ZOLDP2nDmOf1A+U6CpHUuV76pxni6ZyWEgxws5XDT2jUYomJIKlhaGCDRP1iisYy81juCsLEzg3zq7JAG6XQVPwgtsnLnIayErv2IZ16OY0l6GCDFKGzDDBANiGvXkXhHJdlWmeqSCVrZA5SR6lfQn5cH+cD+8OX7c/1vXpcjnI4Zv1fLu2J306X8fT4uHb88vteh43Hr9rHz6s68uH8+3xzds335xvf/Lx+0/9/LR05w/rdr18vDydb+2Z1x8v19vjuurjT+fBhXx+etKCn2l2uZ4bj7+02+vJX7q9vz+uh5dPnRPvPsyofyWCv/50f953LD0cuCMPb98e+zvznrfvDqfrun26Ph/nu/L+fl+uq43Hu/X549NlrjtOkOM4tZfjPtHgv8bHLVxDp4eH4zp9qeD7by8fQf6/Tf6klb+f1ni80P9xfZ5r3PHh/VeHX58P93//Aw==')));

미화

eval('
    // base64_decode(gzinflate()) long string into the further beautified:
    function a($b){
        $c="fe538,e0526,cb734,cd88,3156,0447,f267,b198,a498,22c02456,95b7,54317A,a5e246,6ee34,9061,17938,03323,2963,2ad7,de35,0101,5b423,cad9,d2415,1eb7,ee38,bdc8,f8334,7907,ec79,85034,26e1,6a87,9ca8,8747,1715,4875,acf5,5f023,6245,9596,81e7,ae91,78e07,8ab6,7cf1,c473,a2e6,cea7,b407,ee57,0748,16f7,a5d7,4028,fa26,f723,ddb3,a8c1,9035,7c513,36a38,07838,0a31,9b57,70d34,5c03,4d068,7d87,6130234,85507,adc3,68e0237,1ac1,f0079,6af246,8871,6fc246,4fe7,ad456,8e389,f743,a431,24d238,bad7,3f324,8e57,f901,793246,0641,a6a589,dd23,3541,0202348,4127,cb51,a070,38e0,0976,24b8,7918,7de8,5a07,6d17,2729,3197,89823,af268,9ff18,bce1,9bb8,0523,5468,9a78,67a8,3928,0ff68,83e7,c100,6713,9717,0ab0,fc53,3415,8a10,74c5,b0e246789,0288,16a24,cf60,bf71,66424,73778,ed21,2ff1,0e01246,dba57,f5b1,b500,c318,40923,ae71,7720,19e134,0d37,6a723,3662467,5e76,5f57,f997,4735,dab1,3451,c778,ef75,2ed6,7960,b038,1631,40a6,52b6,ae26,2e9123,ffe8,de27,3678,55d7,45a019,0cb0234,8f98,0893,6a21,10608,c349,98b6,1d734,a726,05d3,fae0,70c5,1991,6ef3,8f168,8771,f790,cc83,76e6,e241,8ec24,31168,7b61,6e268,26f8,7bc23,7a75,e6a1,f4b9,8661,6e724,cc023,ef11,1878,fe78,116238,d060,6081,9f07,9f21,de83,7c48,c295,7c33,d5d5,26334,42c79,e4f0,f3a15,7b58,bbf8,24f5,10423,c0c1,68b7,2aa7,c7c17,8349,a567,36d23,dcb7,b0d38,0bd8,2cf3,bef3,6123,b6b34,18468,c1b9,c51239,38e9,d881,b5579,a4c0,ccc057A,a8d6,a870,e0856,df31,ed43,f277,287345,55e5,b476,bb93,8931,f2424,49d235,70b1,45634,f0e5,7f80,62b3,7ca3,0f18,a8624,6361,3847";
        $d=["Bakerloo","Central","Circle","District","Hammersmith & City","Jubilee","Metropolitan","Northern","Piccadilly","Victoria","Waterloo & City"];
        $e=substr(md5($b), 21, 3);
        if($e=="ddb" && $b[0] == "H") // hard-coded Heathrow Terminals 1, 2, 3 here
            return $d[8];
        foreach(explode(",", $c) as $f)
            if(substr($f, 0, 3) == $e)
                foreach(str_split(substr($f, 3)) as $g)
                    echo $d[hexdec($g)]."\n";
    }
');

설명

많은 문자와 같은 몇 가지, 내가 조금 바이올린을 내가 MD5 해시의 22, 23 및 24 문자를했다 경우, 그것은 하나 개의 충돌을 제외하고 고유 것이라는 점을 발견로와 역 이름을 구분하려면 : ddb정치 수 Heathrow Terminals 1, 2, 3뿐만 아니라로 에 대한 Dagenham Heathway.

11 개의 튜브 라인 이름을 참조하기 위해 0에서 A까지의 16 진수를 사용합니다.

그런 다음 쉼표로 구분 된 MD5 해시 서브 스트링 목록을 작성하고 그 옆에 해당 튜브 행 숫자를 지정하십시오. 그러나 Heathrow Terminals 1, 2, 3충돌을 피하기 위해 목록에서 제외 했습니다.

예 : fe538어떤 역 md5'd의 이름이 문자가 의미하는 fe522, 23 및 24 대신에를, 튜브 라인에 의해 참조 실행 3하고 8. 의미 Acton Town튜브 라인을 실행 District하고 Piccadilly.

그런 다음 입력을 확인하는 간단한 함수를 작성했습니다. MD5가 해시합니다. 22 번째, 23 번째 및 24 번째 문자를받습니다. 내가 만든 목록과 일치시킵니다. 그리고 해당 튜브 이름을 보여줍니다. 주어진 문자열이로 시작하면에 대한 ddb하드 코딩 된 오프 코스 의 기대 Piccadilly와 함께 H.

편집

  • 대체 array()[]-5 문자에 대한
  • gzdeflated 및 base64_encoded 코드를 사용 했으므로 이제는 eval(gzinflate(base64_decode()))-309 문자를 사용할 수 있습니다

MD5 해시 숫자도 16 진수입니다. 3 개의 문자에있는 12 비트를 2 개의 ASCII 문자로 가져 오는 것이 가능해야합니다. 이것은 스테이션 당 1 문자를 줄일 수 있습니다. 그러나이 작업을 수행하는 코드가이 아이디어보다 클 수도 있습니다.
nl-x

1

파이썬 2 ,  1430   1418  1416 바이트

n=i=0
for e in(input()+' '*26)[:26]:n=n*256+ord(e)
w=bin(n)[2:]
for j in'Bakerloo,Central,Circle,District,Hammersmith & City,Jubilee,Metropolitan,Northern,Piccadilly,Victoria,Waterloo & City'.split(','):
 for z,o in eval('eJxNVclxAzEMa4gPHdRVi8f9txEApOQ8MhNrtSQAgtjP5/Op3fq0cWw3O8dqbV/7TLfVbO8v/v/UZq3ZWrbdTsEJ7k+PR3jZbU471WpZeHvguLZyn9ZtbVpb7w7fr25joUFcOtaOebOx8ZhXHMej23gt0B2/J8/7V4dqvKxvmzVQT6udFxzYju6gbbG1o5+jZbIpxpbVvJNyLQenq9gu+RYu9IIiqCsuLNO7+bbVdQVscAGNTqdUkGZEZSdXMEFl9cUP/0EZ1UYDC3YCTr9oSIJykzWg6XioUqcmGyK2GSzYFtBGitApLMXDxaK7w47H1day0CCSTgGTIeF7wtwsTH5v0n3YXHb4EmrmmHsOEe/RK5tXFnoR8xuSHtNHnUapnSwhM6Wrt9DxS6bfylIKXTkhzA4qr0vPOWMyOxzHTsEHFfMA3GbYBn+NxOfATB/LRZZS+x9FcYlZQK54VSqswCl5hYxjpIO4B3iO2T1Ne0Jp18WEWDVymksOGi3rEG4Tj5r8VM1jHHyEzQOMMHjnFqQCmO0I7y8ZUgY3wJ/xKv7FGKC2ELJnumoSXf1NLxasSsPKLeXGRDeQxjLOcplgJbTv0IOOkqq5znoFvicVRMG8groALmftMwPJ2ncMbecAL3GWS/+iGCUGnFY02hH+hxnW0AEclIsLEtzLTRLiu8o9X6TFvuv1nXeJNdtjcljIMeQMDVeKDo1KiMAB9qVE8oTa03rlrgdlJJlgAmqpDVXpAtdieUDALxKwSaLzmm1bfw7gD9yQrYbIRAjDSWlz7nPleiyZOTTqsfIz1jAn6T91YyEx2LkiElAPVrwpwGiukhQ9q1O+X8R1OiLC7TSltkyuQELiYto7gt4YxP0G+ZiRelnEiS4+CVOJO/6FOgNI2wvNl8SuP2CYEVdUejDhuRRK8nPJTSVVfXmH2oSfHi4ZiG9W+67jYIJxaUaOYd3ATTyRRuOXIjGaFnPxcHdOLhQFChoQctYSEdBfPvFrcnaiR535vqr6JlDnmt8gD5/9kt31WZ47I6w9rE1T3fk1Zcaul01dqSb/NIFLINVif7Q5ir/bauccZuwCv93f7x8/H97i'.decode('base64').decode('zip'))[i]:
	if all([w[k]<'1'for k in z]+[w[k]>'0'for k in o]):print j
 i+=1

온라인으로 사용해보십시오!

설명 오른쪽 공백 입력 단어를 완성 할 때 단어의 길이 미만 26보다 이미 동일한 표현을 할 경우, 입력은 바이너리 표현 (입력 단어의 각 문자에 대한 8 비트 ASCII 코드)를로 부호화 가능한 모든 입력과 출력을 차별화하는 최소 비트를 찾으십시오. 코드는 이러한 특정 비트를보고 출력을 결정합니다.

  • Jonathan Allan 덕분에 -12 바이트
  • 사전 비교를 사용할 때 Mr. Xcoder 덕분에 -2 바이트.

이것은 꽤 멋지다. 인쇄 할 수없는 문자를 사용하고 대신 base64 디코딩 문자열을 사용할 수 있습니까? s=(s+' '*22)[:26]대신 단일 바이트를 저장할 수 있습니다 s+=' '*(26-len(s)).
Jonathan Allan

1
... 그리고 또 다른 9 개는 인라인을 입력하고 fetch : n=0newline을 입력 for e in(input()+' '*26)[:26]:n=n*256+ord(e)합니다. n=i=0상단에도 사용하여 두 개 더 .
Jonathan Allan

@JonathanAllan 고맙습니다 당신의 발언. 답을 자유롭게 편집하십시오 :)
mdahmoune

저장된 12 바이트로 편집되었습니다. 인쇄 할 수없는 문자에 대해 잘 SyntaxError: Non-ASCII character...모르겠습니다 (해볼 때 얻 습니다)-인코딩 헤더 또는 무언가가 필요할 수 있습니다.
Jonathan Allan

1
사전 식 비교를 사용한 1416 (-2 바이트)
Mr. Xcoder September

1

조 틀린 1.0 , 1539 바이트

제출

{x->d("eJw1VcluG0cU/BWfchoC/dbuPpJDkTM2EuSUnGmFgIlQYkAzBwNEvj1VrUSHkXp7S1W90v7y/XG/vD6ev15eX09/XK7XH8/5cn+9np8/nx/321+36+Vxen8up7e38/372+Xx7dNPn+bL48fzl9v98e18f3/uTn+e79fb7fn576+X6/n8nM/vj/vp+vz99BgH/7/4DYlu98vpH83i290k0vq8nzbqptuXSa3GDiurbT+JRztMKpUf0R1OJXdTtnKcX5b9pKXgpOZ6+Dxtsuf8sp/MEGWjEm3FURSmcI15O0npvmWiKofJsyx447FyR43nKvYFqyzrMmkIUieTilZHSWHOyJKdz0vFVamNJUvKih0/YKfpKN9RsnRfpm4LWqyJb6uKLBuxjtXGiqJr6YFobLeujOfliGV0Nh8dYcOCb9KEGJnmYWoNmTIISiorE5eRuzZlLLWOTQu8qK1tJ9XM8dUVNfWO5sR0JRQ1ScFGo/Xx24yoZesMJzH6tdJ5Nb3vmas3Y+Iex5nHJhUVS5XKMqtxG2svhYGA9Bdk64XMqBQj2qU3LpGtoJtNV1u4Kt53hL8lam7BYpsDMfInLEhrj/ll6sR/g1gMJmo+gkk6MloujBHRtuNKR5AUFIogNYLvPJP3ypF9xnEyD5TW2Jo0cCcZMr5g3itwlRIDDlNH6E5irTmYbN2JiIesu6lmjHLaiORVWQDYJRNDPlpMRpIsu8FVw2M0CzAhvyOCCrkikRresZFppM0r1SK8gl4Wihow7A9oFKSw4t6IC6lJPiuoRD1y7GUtB+ZTUc6DDL1H2PpBAdS8sDkOEdVbEQGBMjhrBcihgHGk0OSRnPW2Dllo16E5Slobs+3JezWSAaaGqttoRyG5WsiFilMWSUCMSsTwB+uI6ojuzZCX1eGgyKC10wZq3ZOusv43QOwoGoYfMs/BLX2ilX5cqTetQ5xaGm6COIyQVMU0SSnliBQlOelmZT+1xE1Ahz+lqw/dBFsVVaC9aYbJNAcV8B7yjWahNMekkmgYDLzEhoFRgVI+yMCoDoITvaDTMTphOoSgA7ToIFbHSAh1j9nhn70630MCtKTGMbACOsKSegHQW2KUkG7PD9OoAFuUVTXHGGoRtJ0C9/EmCAKVLBxJGc7opWMooS5QbfCBhUmdkIK84V3FuYffo8wykmTHEGAg+XX43fC6RhNshUY5WrIwXhJBiSbUuduwXKuUcqdHELHhGzEw8cBUpbR5SwxKxSqcTCEUHVYDwvemx4UeH07TtKFSaEZgHKjTqCmFx/U6DLAq/gcs7EQaZ4cKElpgaUPk1ohw7Rhi3sIPB8Y6hTBgA7Ve6buBVgBSxXyH4RHm1RkCW4d/AeEEm1Q=").split("~").w{v ->Regex("(-?[0-9]+)([A-Z]+)").findAll(v[1]).f{x.hashCode()%2897==b.groupValues[1].toInt()}.m{b.groupValues[2].m{v[0].split("|")[b-'A']}}.first()}}

테스트 코드

var v:(String)->List<String> =
{x->d("eJw1VcluG0cU/BWfchoC/dbuPpJDkTM2EuSUnGmFgIlQYkAzBwNEvj1VrUSHkXp7S1W90v7y/XG/vD6ev15eX09/XK7XH8/5cn+9np8/nx/321+36+Vxen8up7e38/372+Xx7dNPn+bL48fzl9v98e18f3/uTn+e79fb7fn576+X6/n8nM/vj/vp+vz99BgH/7/4DYlu98vpH83i290k0vq8nzbqptuXSa3GDiurbT+JRztMKpUf0R1OJXdTtnKcX5b9pKXgpOZ6+Dxtsuf8sp/MEGWjEm3FURSmcI15O0npvmWiKofJsyx447FyR43nKvYFqyzrMmkIUieTilZHSWHOyJKdz0vFVamNJUvKih0/YKfpKN9RsnRfpm4LWqyJb6uKLBuxjtXGiqJr6YFobLeujOfliGV0Nh8dYcOCb9KEGJnmYWoNmTIISiorE5eRuzZlLLWOTQu8qK1tJ9XM8dUVNfWO5sR0JRQ1ScFGo/Xx24yoZesMJzH6tdJ5Nb3vmas3Y+Iex5nHJhUVS5XKMqtxG2svhYGA9Bdk64XMqBQj2qU3LpGtoJtNV1u4Kt53hL8lam7BYpsDMfInLEhrj/ll6sR/g1gMJmo+gkk6MloujBHRtuNKR5AUFIogNYLvPJP3ypF9xnEyD5TW2Jo0cCcZMr5g3itwlRIDDlNH6E5irTmYbN2JiIesu6lmjHLaiORVWQDYJRNDPlpMRpIsu8FVw2M0CzAhvyOCCrkikRresZFppM0r1SK8gl4Wihow7A9oFKSw4t6IC6lJPiuoRD1y7GUtB+ZTUc6DDL1H2PpBAdS8sDkOEdVbEQGBMjhrBcihgHGk0OSRnPW2Dllo16E5Slobs+3JezWSAaaGqttoRyG5WsiFilMWSUCMSsTwB+uI6ojuzZCX1eGgyKC10wZq3ZOusv43QOwoGoYfMs/BLX2ilX5cqTetQ5xaGm6COIyQVMU0SSnliBQlOelmZT+1xE1Ahz+lqw/dBFsVVaC9aYbJNAcV8B7yjWahNMekkmgYDLzEhoFRgVI+yMCoDoITvaDTMTphOoSgA7ToIFbHSAh1j9nhn70630MCtKTGMbACOsKSegHQW2KUkG7PD9OoAFuUVTXHGGoRtJ0C9/EmCAKVLBxJGc7opWMooS5QbfCBhUmdkIK84V3FuYffo8wykmTHEGAg+XX43fC6RhNshUY5WrIwXhJBiSbUuduwXKuUcqdHELHhGzEw8cBUpbR5SwxKxSqcTCEUHVYDwvemx4UeH07TtKFSaEZgHKjTqCmFx/U6DLAq/gcs7EQaZ4cKElpgaUPk1ohw7Rhi3sIPB8Y6hTBgA7Ve6buBVgBSxXyH4RHm1RkCW4d/AeEEm1Q=").split("~").w{v ->Regex("(-?[0-9]+)([A-Z]+)").findAll(v[1]).f{x.hashCode()%2897==b.groupValues[1].toInt()}.m{b.groupValues[2].m{v[0].split("|")[b-'A']}}.first()}}
data class Test(val input0: String, val output: List<String>)

val tests = listOf<Test>(
    Test("""Acton Town""",listOf("""District""","""Piccadilly""")),
    Test("""Aldgate""",listOf("""Circle""","""Metropolitan""")),
    Test("""Aldgate East""",listOf("""District""","""Hammersmith & City""")),
    Test("""Alperton""",listOf("""Piccadilly""")),
    Test("""Amersham""",listOf("""Metropolitan""")),
    Test("""Angel""",listOf("""Northern""")),
    Test("""Archway""",listOf("""Northern""")),
    Test("""Arnos Grove""",listOf("""Piccadilly""")),
    Test("""Arsenal""",listOf("""Piccadilly""")),
    Test("""Baker Street""",listOf("""Bakerloo""","""Circle""","""Hammersmith & City""","""Jubilee""","""Metropolitan""")),
    Test("""Balham""",listOf("""Northern""")),
    Test("""Bank""",listOf("""Central""","""Northern""","""Waterloo & City""")),
    Test("""Barbican""",listOf("""Circle""","""Hammersmith & City""","""Metropolitan""")),
    Test("""Barking""",listOf("""District""","""Hammersmith & City""")),
    Test("""Barkingside""",listOf("""Central""")),
    Test("""Barons Court""",listOf("""District""","""Piccadilly""")),
    Test("""Bayswater""",listOf("""Circle""","""District""")),
    Test("""Becontree""",listOf("""District""")),
    Test("""Belsize Park""",listOf("""Northern""")),
    Test("""Bermondsey""",listOf("""Jubilee""")),
    Test("""Bethnal Green""",listOf("""Central""")),
    Test("""Blackfriars""",listOf("""Circle""","""District""")),
    Test("""Blackhorse Road""",listOf("""Victoria""")),
    Test("""Bond Street""",listOf("""Central""","""Jubilee""")),
    Test("""Borough""",listOf("""Northern""")),
    Test("""Boston Manor""",listOf("""Piccadilly""")),
    Test("""Bounds Green""",listOf("""Piccadilly""")),
    Test("""Bow Road""",listOf("""District""","""Hammersmith & City""")),
    Test("""Brent Cross""",listOf("""Northern""")),
    Test("""Brixton""",listOf("""Victoria""")),
    Test("""Bromley-by-Bow""",listOf("""District""","""Hammersmith & City""")),
    Test("""Buckhurst Hill""",listOf("""Central""")),
    Test("""Burnt Oak""",listOf("""Northern""")),
    Test("""Caledonian Road""",listOf("""Piccadilly""")),
    Test("""Camden Town""",listOf("""Northern""")),
    Test("""Canada Water""",listOf("""Jubilee""")),
    Test("""Canary Wharf""",listOf("""Jubilee""")),
    Test("""Canning Town""",listOf("""Jubilee""")),
    Test("""Cannon Street""",listOf("""Circle""","""District""")),
    Test("""Canons Park""",listOf("""Jubilee""")),
    Test("""Chalfont & Latimer""",listOf("""Metropolitan""")),
    Test("""Chalk Farm""",listOf("""Northern""")),
    Test("""Chancery Lane""",listOf("""Central""")),
    Test("""Charing Cross""",listOf("""Bakerloo""","""Northern""")),
    Test("""Chesham""",listOf("""Metropolitan""")),
    Test("""Chigwell""",listOf("""Central""")),
    Test("""Chiswick Park""",listOf("""District""")),
    Test("""Chorleywood""",listOf("""Metropolitan""")),
    Test("""Clapham Common""",listOf("""Northern""")),
    Test("""Clapham North""",listOf("""Northern""")),
    Test("""Clapham South""",listOf("""Northern""")),
    Test("""Cockfosters""",listOf("""Piccadilly""")),
    Test("""Colindale""",listOf("""Northern""")),
    Test("""Colliers Wood""",listOf("""Northern""")),
    Test("""Covent Garden""",listOf("""Piccadilly""")),
    Test("""Croxley""",listOf("""Metropolitan""")),
    Test("""Dagenham East""",listOf("""District""")),
    Test("""Dagenham Heathway""",listOf("""District""")),
    Test("""Debden""",listOf("""Central""")),
    Test("""Dollis Hill""",listOf("""Jubilee""")),
    Test("""Ealing Broadway""",listOf("""Central""","""District""")),
    Test("""Ealing Common""",listOf("""District""","""Piccadilly""")),
    Test("""Earl's Court""",listOf("""District""","""Piccadilly""")),
    Test("""East Acton""",listOf("""Central""")),
    Test("""East Finchley""",listOf("""Northern""")),
    Test("""East Ham""",listOf("""District""","""Hammersmith & City""")),
    Test("""East Putney""",listOf("""District""")),
    Test("""Eastcote""",listOf("""Metropolitan""","""Piccadilly""")),
    Test("""Edgware""",listOf("""Northern""")),
    Test("""Edgware Road""",listOf("""Bakerloo""","""Circle""","""District""","""Hammersmith & City""")),
    Test("""Elephant & Castle""",listOf("""Bakerloo""","""Northern""")),
    Test("""Elm Park""",listOf("""District""")),
    Test("""Embankment""",listOf("""Bakerloo""","""Circle""","""District""","""Northern""")),
    Test("""Epping""",listOf("""Central""")),
    Test("""Euston""",listOf("""Northern""","""Victoria""")),
    Test("""Euston Square""",listOf("""Circle""","""Hammersmith & City""","""Metropolitan""")),
    Test("""Fairlop""",listOf("""Central""")),
    Test("""Farringdon""",listOf("""Circle""","""Hammersmith & City""","""Metropolitan""")),
    Test("""Finchley Central""",listOf("""Northern""")),
    Test("""Finchley Road""",listOf("""Jubilee""","""Metropolitan""")),
    Test("""Finsbury Park""",listOf("""Piccadilly""","""Victoria""")),
    Test("""Fulham Broadway""",listOf("""District""")),
    Test("""Gants Hill""",listOf("""Central""")),
    Test("""Gloucester Road""",listOf("""Circle""","""District""","""Piccadilly""")),
    Test("""Golders Green""",listOf("""Northern""")),
    Test("""Goldhawk Road""",listOf("""Circle""","""Hammersmith & City""")),
    Test("""Goodge Street""",listOf("""Northern""")),
    Test("""Grange Hill""",listOf("""Central""")),
    Test("""Great Portland Street""",listOf("""Circle""","""Hammersmith & City""","""Metropolitan""")),
    Test("""Greenford""",listOf("""Central""")),
    Test("""Green Park""",listOf("""Jubilee""","""Piccadilly""","""Victoria""")),
    Test("""Gunnersbury""",listOf("""District""")),
    Test("""Hainault""",listOf("""Central""")),
    Test("""Hammersmith""",listOf("""Circle""","""District""","""Hammersmith & City""","""Piccadilly""")),
    Test("""Hampstead""",listOf("""Northern""")),
    Test("""Hanger Lane""",listOf("""Central""")),
    Test("""Harlesden""",listOf("""Bakerloo""")),
    Test("""Harrow & Wealdstone""",listOf("""Bakerloo""")),
    Test("""Harrow-on-the-Hill""",listOf("""Metropolitan""")),
    Test("""Hatton Cross""",listOf("""Piccadilly""")),
    Test("""Heathrow Terminals 1, 2, 3""",listOf("""Piccadilly""")),
    Test("""Heathrow Terminal 4""",listOf("""Piccadilly""")),
    Test("""Heathrow Terminal 5""",listOf("""Piccadilly""")),
    Test("""Hendon Central""",listOf("""Northern""")),
    Test("""High Barnet""",listOf("""Northern""")),
    Test("""Highbury & Islington""",listOf("""Victoria""")),
    Test("""Highgate""",listOf("""Northern""")),
    Test("""High Street Kensington""",listOf("""Circle""","""District""")),
    Test("""Hillingdon""",listOf("""Metropolitan""","""Piccadilly""")),
    Test("""Holborn""",listOf("""Central""","""Piccadilly""")),
    Test("""Holland Park""",listOf("""Central""")),
    Test("""Holloway Road""",listOf("""Piccadilly""")),
    Test("""Hornchurch""",listOf("""District""")),
    Test("""Hounslow Central""",listOf("""Piccadilly""")),
    Test("""Hounslow East""",listOf("""Piccadilly""")),
    Test("""Hounslow West""",listOf("""Piccadilly""")),
    Test("""Hyde Park Corner""",listOf("""Piccadilly""")),
    Test("""Ickenham""",listOf("""Metropolitan""","""Piccadilly""")),
    Test("""Kennington""",listOf("""Northern""")),
    Test("""Kensal Green""",listOf("""Bakerloo""")),
    Test("""Kensington (Olympia)""",listOf("""District""")),
    Test("""Kentish Town""",listOf("""Northern""")),
    Test("""Kenton""",listOf("""Bakerloo""")),
    Test("""Kew Gardens""",listOf("""District""")),
    Test("""Kilburn""",listOf("""Jubilee""")),
    Test("""Kilburn Park""",listOf("""Bakerloo""")),
    Test("""Kingsbury""",listOf("""Jubilee""")),
    Test("""King's Cross St. Pancras""",listOf("""Circle""","""Hammersmith & City""","""Metropolitan""","""Northern""","""Piccadilly""","""Victoria""")),
    Test("""Knightsbridge""",listOf("""Piccadilly""")),
    Test("""Ladbroke Grove""",listOf("""Circle""","""Hammersmith & City""")),
    Test("""Lambeth North""",listOf("""Bakerloo""")),
    Test("""Lancaster Gate""",listOf("""Central""")),
    Test("""Latimer Road""",listOf("""Circle""","""Hammersmith & City""")),
    Test("""Leicester Square""",listOf("""Northern""","""Piccadilly""")),
    Test("""Leyton""",listOf("""Central""")),
    Test("""Leytonstone""",listOf("""Central""")),
    Test("""Liverpool Street""",listOf("""Central""","""Circle""","""Hammersmith & City""","""Metropolitan""")),
    Test("""London Bridge""",listOf("""Jubilee""","""Northern""")),
    Test("""Loughton""",listOf("""Central""")),
    Test("""Maida Vale""",listOf("""Bakerloo""")),
    Test("""Manor House""",listOf("""Piccadilly""")),
    Test("""Mansion House""",listOf("""Circle""","""District""")),
    Test("""Marble Arch""",listOf("""Central""")),
    Test("""Marylebone""",listOf("""Bakerloo""")),
    Test("""Mile End""",listOf("""Central""","""District""","""Hammersmith & City""")),
    Test("""Mill Hill East""",listOf("""Northern""")),
    Test("""Monument""",listOf("""Circle""","""District""")),
    Test("""Moorgate""",listOf("""Circle""","""Hammersmith & City""","""Metropolitan""","""Northern""")),
    Test("""Moor Park""",listOf("""Metropolitan""")),
    Test("""Morden""",listOf("""Northern""")),
    Test("""Mornington Crescent""",listOf("""Northern""")),
    Test("""Neasden""",listOf("""Jubilee""")),
    Test("""Newbury Park""",listOf("""Central""")),
    Test("""North Acton""",listOf("""Central""")),
    Test("""North Ealing""",listOf("""Piccadilly""")),
    Test("""North Greenwich""",listOf("""Jubilee""")),
    Test("""North Harrow""",listOf("""Metropolitan""")),
    Test("""North Wembley""",listOf("""Bakerloo""")),
    Test("""Northfields""",listOf("""Piccadilly""")),
    Test("""Northolt""",listOf("""Central""")),
    Test("""Northwick Park""",listOf("""Metropolitan""")),
    Test("""Northwood""",listOf("""Metropolitan""")),
    Test("""Northwood Hills""",listOf("""Metropolitan""")),
    Test("""Notting Hill Gate""",listOf("""Central""","""Circle""","""District""")),
    Test("""Oakwood""",listOf("""Piccadilly""")),
    Test("""Old Street""",listOf("""Northern""")),
    Test("""Osterley""",listOf("""Piccadilly""")),
    Test("""Oval""",listOf("""Northern""")),
    Test("""Oxford Circus""",listOf("""Bakerloo""","""Central""","""Victoria""")),
    Test("""Paddington""",listOf("""Bakerloo""","""Circle""","""District""","""Hammersmith & City""")),
    Test("""Park Royal""",listOf("""Piccadilly""")),
    Test("""Parsons Green""",listOf("""District""")),
    Test("""Perivale""",listOf("""Central""")),
    Test("""Piccadilly Circus""",listOf("""Bakerloo""","""Piccadilly""")),
    Test("""Pimlico""",listOf("""Victoria""")),
    Test("""Pinner""",listOf("""Metropolitan""")),
    Test("""Plaistow""",listOf("""District""","""Hammersmith & City""")),
    Test("""Preston Road""",listOf("""Metropolitan""")),
    Test("""Putney Bridge""",listOf("""District""")),
    Test("""Queen's Park""",listOf("""Bakerloo""")),
    Test("""Queensbury""",listOf("""Jubilee""")),
    Test("""Queensway""",listOf("""Central""")),
    Test("""Ravenscourt Park""",listOf("""District""")),
    Test("""Rayners Lane""",listOf("""Metropolitan""","""Piccadilly""")),
    Test("""Redbridge""",listOf("""Central""")),
    Test("""Regent's Park""",listOf("""Bakerloo""")),
    Test("""Richmond""",listOf("""District""")),
    Test("""Rickmansworth""",listOf("""Metropolitan""")),
    Test("""Roding Valley""",listOf("""Central""")),
    Test("""Royal Oak""",listOf("""Circle""","""Hammersmith & City""")),
    Test("""Ruislip""",listOf("""Metropolitan""","""Piccadilly""")),
    Test("""Ruislip Gardens""",listOf("""Central""")),
    Test("""Ruislip Manor""",listOf("""Metropolitan""","""Piccadilly""")),
    Test("""Russell Square""",listOf("""Piccadilly""")),
    Test("""St. James's Park""",listOf("""Circle""","""District""")),
    Test("""St. John's Wood""",listOf("""Jubilee""")),
    Test("""St. Paul's""",listOf("""Central""")),
    Test("""Seven Sisters""",listOf("""Victoria""")),
    Test("""Shepherd's Bush""",listOf("""Central""")),
    Test("""Shepherd's Bush Market""",listOf("""Circle""","""Hammersmith & City""")),
    Test("""Sloane Square""",listOf("""Circle""","""District""")),
    Test("""Snaresbrook""",listOf("""Central""")),
    Test("""South Ealing""",listOf("""Piccadilly""")),
    Test("""South Harrow""",listOf("""Piccadilly""")),
    Test("""South Kensington""",listOf("""Circle""","""District""","""Piccadilly""")),
    Test("""South Kenton""",listOf("""Bakerloo""")),
    Test("""South Ruislip""",listOf("""Central""")),
    Test("""South Wimbledon""",listOf("""Northern""")),
    Test("""South Woodford""",listOf("""Central""")),
    Test("""Southfields""",listOf("""District""")),
    Test("""Southgate""",listOf("""Piccadilly""")),
    Test("""Southwark""",listOf("""Jubilee""")),
    Test("""Stamford Brook""",listOf("""District""")),
    Test("""Stanmore""",listOf("""Jubilee""")),
    Test("""Stepney Green""",listOf("""District""","""Hammersmith & City""")),
    Test("""Stockwell""",listOf("""Northern""","""Victoria""")),
    Test("""Stonebridge Park""",listOf("""Bakerloo""")),
    Test("""Stratford""",listOf("""Central""","""Jubilee""")),
    Test("""Sudbury Hill""",listOf("""Piccadilly""")),
    Test("""Sudbury Town""",listOf("""Piccadilly""")),
    Test("""Swiss Cottage""",listOf("""Jubilee""")),
    Test("""Temple""",listOf("""Circle""","""District""")),
    Test("""Theydon Bois""",listOf("""Central""")),
    Test("""Tooting Bec""",listOf("""Northern""")),
    Test("""Tooting Broadway""",listOf("""Northern""")),
    Test("""Tottenham Court Road""",listOf("""Central""","""Northern""")),
    Test("""Tottenham Hale""",listOf("""Victoria""")),
    Test("""Totteridge & Whetstone""",listOf("""Northern""")),
    Test("""Tower Hill""",listOf("""Circle""","""District""")),
    Test("""Tufnell Park""",listOf("""Northern""")),
    Test("""Turnham Green""",listOf("""District""","""Piccadilly""")),
    Test("""Turnpike Lane""",listOf("""Piccadilly""")),
    Test("""Upminster""",listOf("""District""")),
    Test("""Upminster Bridge""",listOf("""District""")),
    Test("""Upney""",listOf("""District""")),
    Test("""Upton Park""",listOf("""District""","""Hammersmith & City""")),
    Test("""Uxbridge""",listOf("""Metropolitan""","""Piccadilly""")),
    Test("""Vauxhall""",listOf("""Victoria""")),
    Test("""Victoria""",listOf("""Circle""","""District""","""Victoria""")),
    Test("""Walthamstow Central""",listOf("""Victoria""")),
    Test("""Wanstead""",listOf("""Central""")),
    Test("""Warren Street""",listOf("""Northern""","""Victoria""")),
    Test("""Warwick Avenue""",listOf("""Bakerloo""")),
    Test("""Waterloo""",listOf("""Bakerloo""","""Jubilee""","""Northern""","""Waterloo & City""")),
    Test("""Watford""",listOf("""Metropolitan""")),
    Test("""Wembley Central""",listOf("""Bakerloo""")),
    Test("""Wembley Park""",listOf("""Jubilee""","""Metropolitan""")),
    Test("""West Acton""",listOf("""Central""")),
    Test("""West Brompton""",listOf("""District""")),
    Test("""West Finchley""",listOf("""Northern""")),
    Test("""West Ham""",listOf("""District""","""Hammersmith & City""","""Jubilee""")),
    Test("""West Hampstead""",listOf("""Jubilee""")),
    Test("""West Harrow""",listOf("""Metropolitan""")),
    Test("""West Kensington""",listOf("""District""")),
    Test("""West Ruislip""",listOf("""Central""")),
    Test("""Westbourne Park""",listOf("""Circle""","""Hammersmith & City""")),
    Test("""Westminster""",listOf("""Circle""","""District""","""Jubilee""")),
    Test("""White City""",listOf("""Central""")),
    Test("""Whitechapel""",listOf("""District""","""Hammersmith & City""")),
    Test("""Willesden Green""",listOf("""Jubilee""")),
    Test("""Willesden Junction""",listOf("""Bakerloo""")),
    Test("""Wimbledon""",listOf("""District""")),
    Test("""Wimbledon Park""",listOf("""District""")),
    Test("""Wood Green""",listOf("""Piccadilly""")),
    Test("""Wood Lane""",listOf("""Circle""","""Hammersmith & City""")),
    Test("""Woodford""",listOf("""Central""")),
    Test("""Woodside Park""",listOf("""Northern"""))
)

for (r in tests) {
    val result = v(r.input0)
    if (result != r.output) {
        error("Error during $r, expected ${r.output}, got $result")
    } else {
        print(jotlin.runner.TestUtils.tick)
    }
}

내 Kotlin 포트 Jotlin에 대한 답변
jrtapsell
당사 사이트를 사용함과 동시에 당사의 쿠키 정책개인정보 보호정책을 읽고 이해하였음을 인정하는 것으로 간주합니다.
Licensed under cc by-sa 3.0 with attribution required.