管上某处……但在哪条线上?


26

伦敦地铁又名地铁是世界上最古老的地下铁路,它目前由11行(因为“Edgware路”和“哈默”各占据两个位置严格269 **站)* 267个服务站命名

挑战

输出以名称为输入的服务站的线路名称。

输入:
字符串或字符列表

  • 可以假定这是一个有效的站名(如下面的代码块中所列)。

  • 您可以假设&输入中的任何内容将始终是单词and(或And),如果您愿意,只需在答案中清楚说明即可。

输出:
单独的输出列出了服务该站的十一条线路的输出:

  • 字符串列表,字符列表,打印文本,字符串,字符列表;如果有疑问请问。

  • 如果愿意,您可以始终输出单词and(或And)代替任何单词&,只需在答案中清楚说明。

  • 需要注意的是,如果打印或返回一个字符串或字符列表,则在任何行名(包括the &andor Andused)中都不存在使用的分隔符-子字符串-因此,这排除了使用单个空格字符作为分隔符。

试管网络
-注意:这是最终状态,即使它碰巧包含拼写错误(除非在回答前得到解决)

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"]

...十一行名称是:

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

*运输对于伦敦来说,它也管理其他火车线路,有些也可能被称为“地铁”的一部分(很可能是“港区轻轨”或“ DLR”),但我们将坚持此处列出的十一条。

**链接的Wikipedia页面当前显示270,但是我相信他们错误地算出了Canary Wharf的第二个位置,即使它仅服务于“ DLR”)


使用Mornington Crescent此处提供兼容的IDE )进行高尔夫投稿时,产生假想的布朗尼点(可能还会有很多投票)!


这是,因此,每种语言以字节为单位的最短代码获胜,而解决方案的最短者获胜(不要让打高尔夫的语言让您以其他语言打高尔夫)。玩得开心!


1
我要把这个留在这里。我什至不想提交这个答案。> _>我没有……意识到这有多大……
完全人类的

2
@icrieverytim戴上高尔夫球手套:)
乔纳森·艾伦

只是... 一系列的管子,对不对?\ _(ツ)_ /¯–
Arnauld

2
@Arnauld确实,的确不是,是的。您可以“上管”,可以“更换管”,可以“放在错误的管上”,可以“获得第一个管”或“获得最后一个管” ...但只有一个管:)
乔纳森·艾伦

3
现在与Jay Foreman 一起唱歌
TRiG

Answers:


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丰富的内置文档附带了简洁的示例。这些页面中有几个恰好使用伦敦地铁网络来演示与图形相关的功能。由于名称简短,我们将使用“旅行计划”特色示例中的图表。

这是同一网络的其他出色用法

我不认为以编程方式访问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.nb查看它的完整路径,请运行FindFile["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_}

制作查询表

现在,我们可以匹配v1v2lines,但我们希望{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编程云。转到此处,单击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.nbgWorkaround


测试数据

调用该函数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+(带有<文档名称>”),绝对是对外部资源的临界使用,但是我看到了很多努力(尤其是笔记本已经过时了)。
乔纳森·艾伦,

是的,Mathematica实际上附带了其文档。
hftf

如果默认情况下该示例文件附带了该语言,则我认为没有使用任何漏洞(由于Mathematica不是免费的,所以我无法验证这一点,因此,如果有其他人可以亲自确认,我将不胜感激)。顺便说一句好答案!
乔纳森·艾伦,

16

ES6,Node.js的/镀铬,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为基数R [...]中Z表示的数学整数值。如果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"

步骤三

我们将结果字符串解析为以36为底的数量:

id = parseInt(str, 36)

给出3793395908848905700(这是Chrome V8返回的近似结果)。

第四步

我们计算哈希值:

hash = id * 79 % 2777 % 2328

这给了533

注意:由于精度下降,该结果在数学上不正确(应为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)

在我们的示例中,mskhold 1200000001100二进制形式。因此,我们保留了第3个和第4个站点,这将导致最终结果:[ 'Circle', 'District' ]


@JonathanAllan不是吗?对我来说,它回来了Northern
Erik the Outgolfer

您可以使用RegPack压缩脚本来节省3个字节。

@ThePirateBay(更新)我通过重新编码主数据字符串节省了46个字节,因此它不再对RegPack友好。
Arnauld

出于兴趣,您所指的不一致之处是什么?
尼尔于2009年

1
@Neil 从规范开始令mathInt为Z以基数R表示的数学整数值[...]。如果R不是2、4、8、10、16或32,则mathInt可以是与实现相关的近似值,该近似值由基数R表示的Z表示的数学整数值。
Arnauld

5

Kotlin2271 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。–
乔纳森·艾伦

希望使用Java的zip工具来压缩字符串,应该使字节数更多一些
jrtapsell

5

Python 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]

在线尝试!

-6感谢Xcoder先生

时间太长...也许是高尔夫球场。



1813个字节使用其他查找方法。使用@mdahmoune编码的1498字节
TFeld

1498字节 @EriktheOutgolfer我不知何故复制了错误的链接..我在这里..
TFeld

1
忘记删除重复项(多个具有相同名称和相同行的站点): 1708字节1434字节
TFeld


3

肉桂胶,2100字节

十六进制转储:

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                                ....

在线尝试!

我毫不怀疑,这是可以golfed 越多,问题是肉桂色的口香糖缺乏完整的文档中。(@quartata认为这很有可能成为令人惊叹的巨魔语言)。

是我整理在一起以生成压缩字符串的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的十六进制数字。

然后,我创建了一个用逗号分隔的MD5哈希子字符串列表,其旁边是相应的竖线数字。但是我确实没有Heathrow Terminals 1, 2, 3列出来避免碰撞。

示例:fe538表示无论名称是md5的电台在第22、23 fe5和24位都有字符,都将运行由3和引用的管道8。含义Acton Town运行管线DistrictPiccadilly

然后,我编写了一个简单的函数来检查输入。MD5对其进行哈希处理。包含22、23和24个字符。将其与我创建的列表进行匹配。并显示相应的管名。当给定的字符串以a开头时ddb,期望值是硬编码PiccadillyH

编辑

  • 更换array()[]的-5个字符
  • 使用gzdeflated和base64_encoded我的代码,因此现在可以eval(gzinflate(base64_decode()))用于-309个字符

MD5哈希数字也是十六进制的。应该将三个字符中的12位转换为2个ascii字符。这样可以减少每个站1个字符。但是执行此操作的代码可能胜过这个想法……
nl-x

1

Python 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码)。所有可能的输入,并找到区分输出的最小位。该代码查看这些特定位以决定输出。

  • -12个字节感谢Jonathan Allan。
  • -2字节感谢Xcoder先生在使用字典比较时。

这很酷。您可以使用无法打印的字符,而是使用base64解码的字符串吗?可以保存一个字节s=(s+' '*22)[:26]而不是s+=' '*(26-len(s))
乔纳森·艾伦

1
...以及另外九个,通过内联并输入fetch:n=0newline for e in(input()+' '*26)[:26]:n=n*256+ord(e)n=i=0顶部也使用了两个。
乔纳森·艾伦

@JonathanAllan感谢您的发言。请随意编辑答案:)
mdahmoune17年

编辑后以12个字节保存。我不确定不可打印的字符(SyntaxError: Non-ASCII character...尝试时会得到)-可能需要编码标头或其他内容。
乔纳森·艾伦,

1
1416(-2字节),使用字典比较。
Xcoder先生17年

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)
    }
}

我的科特林港口对乔特林的回应
jrtapsell 18-4-3
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.