LCS

Submit

Your name:
File:
Open code-statistics:

Language is selected by the extension of the file. See the list of supported languages to know the extension of your language.

Problem

Find longest common subsequence (http://en.wikipedia.org/wiki/Longest-common_subsequence_problem)
of two lines.

If more than one solutions exist, prefer leftmost matches in the first line.

Options

exec is denied

no deadline, the server will not save your submission

Sample input:_

AAXXBCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
BCXXAADEFGHIJKLMNOPQRSTUVWXYZ0123456789

Sample output:

AADEFGHIJKLMNOPQRSTUVWXYZ0123456789

Sample input:_

abracadabrabradabrabracadabrarabraracadabraabrabracadabra
abracadabrabradabraabradabracadabraabraabracadabrabradabracadabra

Sample output:

abracadabrabradabrabracadabraabraracadabrabrabracadabra

Sample input:_

10011100100011111101010111011011100101001100111011000100110110010000011011100111100010000100000101010110100001011000001100000000001111110001001000010110101000110011011000001111001010010001001011101111
00101101101010111001000100110000000100001101011110010100001000111001000100011001001100101000100100111010000010100100110111101101000010011001100010101010011001001110001011101110110000110100011011100001

Sample output:

0010110110101011100100010011000000010000110101111000100001000001010011010000101000001100000000001111110001001000010101010011001011000111101010000010001101111

Ranking

Ruby _

RankUserSizeTimeDateStatistics
1leonid890.03772009/10/15 18:16:460B / 49B / 39B
2fsystem1030.19472007/11/12 00:08:340B / ?B / ?B
3shinh1100.22022007/02/13 04:12:28?B / ?B / ?B
4eban1490.49262007/02/13 13:02:19?B / ?B / ?B
5znz1800.23482007/02/13 02:01:40?B / ?B / ?B

Perl _

RankUserSizeTimeDateStatistics
1tails790.05142011/06/14 02:16:4510B / 42B / 25B

Python _

RankUserSizeTimeDateStatistics
1hallvabo1440.07872010/10/20 17:09:3136B / 62B / 45B
2Mark Byers1740.35972007/04/16 00:11:4952B / 77B / 41B

Python3 _

RankUserSizeTimeDateStatistics
1albanian_laundromat2280.13802023/10/07 03:55:510B / 172B / 56B

PHP _

RankUserSizeTimeDateStatistics
1o-cn1450.01232010/01/01 21:22:4773B / ?B / ?B

Scheme _

RankUserSizeTimeDateStatistics
1ma911.67532007/03/05 18:23:430B / ?B / ?B
2_1390.77832007/02/22 22:33:380B / 88B / 42B
3theoria2090.40882007/02/18 01:46:200B / ?B / ?B

Common LISP _

RankUserSizeTimeDateStatistics
1kozima(embed)1810.35922007/04/27 22:53:000B / 152B / 29B

JavaScript _

RankUserSizeTimeDateStatistics
1nn(embed)1660.07572008/06/12 16:10:150B / 98B / 65B
2nn(embed-1.9)1690.00392010/03/16 22:12:560B / 102B / 62B
3Dashiva1910.14852007/04/21 01:17:080B / 127B / 62B

Smalltalk _

RankUserSizeTimeDateStatistics
1murky-satyr1610.45982008/07/13 11:24:510B / 120B / 40B
2sumim2640.76982007/02/17 00:26:480B / 175B / 69B

Prolog _

RankUserSizeTimeDateStatistics
1mskzzzz3140.19122007/05/21 04:24:450B / 275B / 36B

BASIC _

RankUserSizeTimeDateStatistics
1poop3030.15562007/09/03 02:00:070B / 261B / 32B

Perl6 _

RankUserSizeTimeDateStatistics
1Hydrazer4181.20092021/06/16 08:31:240B / 370B / 24B

J _

RankUserSizeTimeDateStatistics
1pooq1490.22882009/01/11 20:36:190B / 103B / 46B

C _

RankUserSizeTimeDateStatistics
151b1950.08762008/06/12 21:15:570B / 121B / 73B
251b(embed)2890.07982007/06/16 18:00:390B / 266B / 23B
3not embed. leftmost? see http://shinh.skr.jp/m/?date=20070213#c1215840.08172007/03/07 18:06:1676B / ?B / ?B

OCaml _

RankUserSizeTimeDateStatistics
1m.ukai2520.72602007/03/08 22:29:080B / 201B / 39B

Haskell _

RankUserSizeTimeDateStatistics
1rst76(not embed)1740.88802012/04/10 22:51:110B / 86B / 75B
2rst76(embed)1740.04392012/04/11 06:58:530B / 92B / 77B
3Magnus Jonsson2440.39652007/03/18 15:26:410B / ?B / ?B
4[1..100]>>=pen. leftmost? see http://shinh.skr.jp/m/?date=20070213#c126970.49912007/03/08 19:44:350B / ?B / ?B

AWK _

RankUserSizeTimeDateStatistics
1nn1640.06102009/08/18 23:09:0210B / 70B / 83B
2usa(cheat)2580.07172007/02/19 23:10:590B / 206B / 52B

sed _

RankUserSizeTimeDateStatistics
1emoken1670.16572007/03/11 00:56:380B / 129B / 35B
2shinh1860.11712007/02/13 04:23:16?B / ?B / ?B
3eban2270.24862007/02/13 00:38:12?B / ?B / ?B

bc _

RankUserSizeTimeDateStatistics
1McBusLuck2930.04232020/04/06 17:59:160B / 269B / 21B

Postscript _

RankUserSizeTimeDateStatistics
1ySas(embed)1620.86062007/05/16 01:05:4478B / 62B / 16B

R _

RankUserSizeTimeDateStatistics
1NikNakk4170.94982014/07/06 01:42:010B / ?B / ?B

Brainfuck _

RankUserSizeTimeDateStatistics
1mitchs (cheat)920.03492015/10/05 10:02:3051B / 5B / 34B

GolfScript _

RankUserSizeTimeDateStatistics
1nooodl710.06362013/08/29 00:17:0412B / ?B / ?B

z80 _

RankUserSizeTimeDateStatistics
1fsystem890.01582008/01/01 00:53:4656B / 18B / 10B

Vim _

RankUserSizeTimeDateStatistics
1clock680.08072011/12/10 02:21:200B / 56B / 11B
2nn760.07692011/12/03 20:29:380B / 48B / 21B

Groovy _

RankUserSizeTimeDateStatistics
1nn1233.55172009/12/16 13:24:410B / 90B / 32B

Scala _

RankUserSizeTimeDateStatistics
1clock1416.77762020/05/12 02:01:340B / 86B / 47B
2zakki17721.69112011/06/13 23:38:430B / 131B / 45B

Language Ranking_

RankLangUserSizeScore
1Vimclock6810000
2GolfScriptnooodl719577
3Perltails798607
4z80fsystem897640
5Rubyleonid897640
6Schemema917472
7Brainfuckmitchs (cheat)927391
8Groovynn1235528
9Scalaclock1414822
10Pythonhallvabo1444722
11PHPo-cn1454689
12Jpooq1494563
13Smalltalkmurky-satyr1614223
14PostscriptySas(embed)1624197
15AWKnn1644146
16JavaScriptnn(embed)1664096
17sedemoken1674071
18Haskellrst76(not embed)1743908
19Common LISPkozima(embed)1813756
20C51b1953487
21Python3albanian_laundromat2282982
22OCamlm.ukai2522698
23bcMcBusLuck2932320
24BASICpoop3032244
25Prologmskzzzz3142165
26RNikNakk4171630
27Perl6Hydrazer4181626

Referer

Note that, they may contain spoilers.

return to the top page