QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#80023#4292. SperhlingNightmaressssAC ✓3ms3552kbC++141.3kb2023-02-21 17:40:482023-02-21 17:40:51

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-02-21 17:40:51]
  • 评测
  • 测评结果:AC
  • 用时:3ms
  • 内存:3552kb
  • [2023-02-21 17:40:48]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;




signed main() {
    cin.tie(0)->sync_with_stdio(0);
	string a, b;
    cin >> a >> b;
    int n = a.size(), m = b.size();
    a = "0" + a; // such that the index of a and b start from 1
    b = "0" + b;
    // dp[i][j] : number of steps required to transform b[1:i] onto a[1:j]
    vector<vector<int>> dp(m + 1, vector<int> (n + 1, 0));
    
    for (int i = 1; i <= n; i++) {
        dp[0][i] = i;
    }
    for (int i = 1; i <= m; i++) {
        dp[i][0] = i;
    }
    
    for (int i = 1; i <= m; i++) {
        for (int j = 1; j <= n; j++) {
            // delete b[i]
            dp[i][j] = dp[i - 1][j] + 1;
            
for (int k = min(i, j); k >= 1; k--) {
                if (b[i] == a[k]) {
                    // when dp[i - 1][k - 1] == 0
                    // a[1:k] == b[1:k], no need to move the cursor
                    dp[i][j] = min(dp[i][j], 
                                dp[i - 1][k - 1] + (dp[i - 1][k - 1] == 0 ? 0 : 2) + j - k);
                }
            }
            // mn[alpha][x][y] := 
            // min{y <= x, a[y + 1] == alpha} dp[x][y] + (dp[x][y] == 0 ? 0 : 2) - y - 1;
            // k = min(dp[i][j], mn[b[i]][i - 1][min(i, j) - 1] + j);
        }
    }
    cout << dp[m][n] << endl;


	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3356kb

input:

mischevious
mischievous

output:

12

result:

ok single line: '12'

Test #2:

score: 0
Accepted
time: 2ms
memory: 3352kb

input:

cerstermergerd
customer

output:

20

result:

ok single line: '20'

Test #3:

score: 0
Accepted
time: 0ms
memory: 3512kb

input:

caitlin
caitlynn

output:

5

result:

ok single line: '5'

Test #4:

score: 0
Accepted
time: 0ms
memory: 3404kb

input:

ieavjozqyqrahhsyvvfvasdvssymrxnfvjlkqoxvuzddbmdrevtzfqcltrgvrbukj
ieavjozqyqrahhsyvvfvasddubezwuvfsntxyahsmjbbpkcgqhkptzybomdhscpjatoxginkvbbjhrtewtbt

output:

103

result:

ok single line: '103'

Test #5:

score: 0
Accepted
time: 2ms
memory: 3376kb

input:

vtboftmvphszwxsuvtgkychqyxkpyatiebcbvtpajixjhx
vwhbbalbyzxhxtsqmgviebeyqfzvgwrnsbf

output:

79

result:

ok single line: '79'

Test #6:

score: 0
Accepted
time: 2ms
memory: 3504kb

input:

ljwxfeouzvoklg
lhgclekhdillcegpozuyishvth

output:

38

result:

ok single line: '38'

Test #7:

score: 0
Accepted
time: 2ms
memory: 3388kb

input:

ykbeobmhpxdsqrufgxkkhtelffdedxorqjxyfmwflbryaungvdumstjsyekalaoqdvnsbqco
ycejbgjtdyosnnvfhwwfgrvtcsmwrewjjl

output:

104

result:

ok single line: '104'

Test #8:

score: 0
Accepted
time: 1ms
memory: 3380kb

input:

idxasopahxthnljgzdgghiyqyxf
ipzac

output:

30

result:

ok single line: '30'

Test #9:

score: 0
Accepted
time: 2ms
memory: 3384kb

input:

cipxgvebbjjznzczwqnihfywuodimsydebwmfaigyahgpbngvvyultadeeumkvfempxcieontopp
cipxgvebbjjznzczwqnihfmmkhcjcfxkebrzukvfdlqddyzsppzaohxjafcqehnmbgyxwdtwkxekl

output:

109

result:

ok single line: '109'

Test #10:

score: 0
Accepted
time: 1ms
memory: 3388kb

input:

ribhncukiogpnsoyxdzavgpwongadexjsjwzbcczvzhjaeaufpubcynuiuygdzeuhuchskewtauatuamzpsfztah
ribhncukiogpnsoyxdzavgpwongadqdakgujumipvoptydnkmcwwsnrazcwmhitrensszzpqmitqtj

output:

108

result:

ok single line: '108'

Test #11:

score: 0
Accepted
time: 0ms
memory: 3512kb

input:

pxolhlnbhnupyexkxzafegzwhfzolnhqgnttpsdhuoobzlnwxhrifgsdgfjnpariqgjgxdmcmnbqtxsbkgefnxs
pxolhlnbhnuplodjfibfasvyksqbuoxdymzhxkpaznozquvhuicwthzqniyzsgko

output:

127

result:

ok single line: '127'

Test #12:

score: 0
Accepted
time: 2ms
memory: 3436kb

input:

mvaqczqxgowcdatezejnabgdmxuhnc
mvaqzlmwjnqwlozsxuajefsbsorgyaxhzkhqep

output:

60

result:

ok single line: '60'

Test #13:

score: 0
Accepted
time: 2ms
memory: 3436kb

input:

pyiequknwhiidfgvqtrphkgkwokyggtyqloizjoytexbsvlqkbypbxitgwopdkgmxyeskycjrgcbduuhkn
pyiequknwhiidfgvqtrphkgkwokyggtyqloizjoytexbsvlqkbypbxitgwopkqlmtqnaypdqoucpgqpdydkghtehgf

output:

52

result:

ok single line: '52'

Test #14:

score: 0
Accepted
time: 2ms
memory: 3396kb

input:

pzjuwxknsvtfzxpw
pznbteyotbjwltfatwivpcrrwpllvssjnscsklwybznvkqykbgkqhybasdwrvlkdritjpilttzkyiuprkj

output:

94

result:

ok single line: '94'

Test #15:

score: 0
Accepted
time: 2ms
memory: 3396kb

input:

mxmblvclgujfrzwgcntghmqpjtmmcucskkakjaxashpagfzsyxjthbjwvsbrvjxsmsxjhyavpwgllktl
mxmnuihx

output:

82

result:

ok single line: '82'

Test #16:

score: 0
Accepted
time: 2ms
memory: 3508kb

input:

tyifhrjbjf
tyifhruowzilrcndhccfzjlscozqjr

output:

28

result:

ok single line: '28'

Test #17:

score: 0
Accepted
time: 2ms
memory: 3520kb

input:

mjrkdnchbjnujugqlpfnqpirjhjncothbhnkduapdcusxxxcenqgykymgvyymcpyjifybplcskaxglkwzsvwzybwfq
mjrkdnchbjnujugqlpnr

output:

74

result:

ok single line: '74'

Test #18:

score: 0
Accepted
time: 2ms
memory: 3360kb

input:

ivonfcanpcxtwoozcqhmekpwzzthzahzkofosoheap
ivonfcanpcxtwoozxruritbsgvgviwnpviwzxqjojyb

output:

53

result:

ok single line: '53'

Test #19:

score: 0
Accepted
time: 1ms
memory: 3512kb

input:

kmfjpkvwu
kmfjpkdsnoprklhmkecmmbmywfpncjjxsjumqjwykfcqvkvziuuttwgeukbkdrbtswwidjcjvivcvsyopnjfedf

output:

84

result:

ok single line: '84'

Test #20:

score: 0
Accepted
time: 2ms
memory: 3500kb

input:

rchxvenyvtawbfovnnbktaotewvbxgyimwjiywqldzvrrclpnmnypccdflvhdphdmlbvbmugj
rchxvenyvtawbxjcdjqwnkzmme

output:

73

result:

ok single line: '73'

Test #21:

score: 0
Accepted
time: 2ms
memory: 3492kb

input:

irgimwvrwnkqxvaityroeyarv
irgimwvrwnkqxvcfjxepsyfwkecreisdffyrtjaaxxjouogynvslbwbnamjlsmscpoelexctdtambawbcmcnkk

output:

83

result:

ok single line: '83'

Test #22:

score: 0
Accepted
time: 2ms
memory: 3484kb

input:

hjolncvpenbfmyg
hjsutzltqfeibsohokhobkqwuaoknxhfdgasuvtmstpddunzqzcdxjlkrzjjzpdzcwwgjlqq

output:

83

result:

ok single line: '83'

Test #23:

score: 0
Accepted
time: 2ms
memory: 3380kb

input:

zayvbqnddxyepyxcsqphm
zayvbqnddxyepyxcs

output:

4

result:

ok single line: '4'

Test #24:

score: 0
Accepted
time: 2ms
memory: 3484kb

input:

yi
yp

output:

2

result:

ok single line: '2'

Test #25:

score: 0
Accepted
time: 1ms
memory: 3376kb

input:

vtdc
vtdcx

output:

1

result:

ok single line: '1'

Test #26:

score: 0
Accepted
time: 0ms
memory: 3376kb

input:

gkyec
he

output:

7

result:

ok single line: '7'

Test #27:

score: 0
Accepted
time: 0ms
memory: 3376kb

input:

ydaha
yvth

output:

7

result:

ok single line: '7'

Test #28:

score: 0
Accepted
time: 1ms
memory: 3428kb

input:

tepnw
np

output:

7

result:

ok single line: '7'

Test #29:

score: 0
Accepted
time: 1ms
memory: 3480kb

input:

g
gpife

output:

4

result:

ok single line: '4'

Test #30:

score: 0
Accepted
time: 2ms
memory: 3380kb

input:

wyvqd
wygun

output:

6

result:

ok single line: '6'

Test #31:

score: 0
Accepted
time: 1ms
memory: 3408kb

input:

h
hawf

output:

3

result:

ok single line: '3'

Test #32:

score: 0
Accepted
time: 2ms
memory: 3376kb

input:

rue
r

output:

2

result:

ok single line: '2'

Test #33:

score: 0
Accepted
time: 0ms
memory: 3404kb

input:

xsd
xsdls

output:

2

result:

ok single line: '2'

Test #34:

score: 0
Accepted
time: 2ms
memory: 3352kb

input:

aiqgk
n

output:

6

result:

ok single line: '6'

Test #35:

score: 0
Accepted
time: 2ms
memory: 3392kb

input:

ffye
fv

output:

4

result:

ok single line: '4'

Test #36:

score: 0
Accepted
time: 2ms
memory: 3356kb

input:

bmwb
q

output:

5

result:

ok single line: '5'

Test #37:

score: 0
Accepted
time: 2ms
memory: 3364kb

input:

kvh
kvw

output:

2

result:

ok single line: '2'

Test #38:

score: 0
Accepted
time: 0ms
memory: 3380kb

input:

z
eqfy

output:

5

result:

ok single line: '5'

Test #39:

score: 0
Accepted
time: 1ms
memory: 3372kb

input:

khjm
kh

output:

2

result:

ok single line: '2'

Test #40:

score: 0
Accepted
time: 1ms
memory: 3380kb

input:

xxrg
uox

output:

7

result:

ok single line: '7'

Test #41:

score: 0
Accepted
time: 2ms
memory: 3392kb

input:

vr
vtc

output:

3

result:

ok single line: '3'

Test #42:

score: 0
Accepted
time: 1ms
memory: 3484kb

input:

m
mflqo

output:

4

result:

ok single line: '4'

Test #43:

score: 0
Accepted
time: 0ms
memory: 3488kb

input:

mfmp
mfwe

output:

4

result:

ok single line: '4'

Test #44:

score: 0
Accepted
time: 2ms
memory: 3448kb

input:

bj
coj

output:

5

result:

ok single line: '5'

Test #45:

score: 0
Accepted
time: 2ms
memory: 3416kb

input:

icqemloejqveyyaoezixasjtvotbnswnuvxmskbuhtamonybflrejbtuwywqhxxnjcgbfpvqczjiefeoeoyzniojphstovaacwaw
icqemloejqveyyaoezixasjtvotbnswnudajoupntstxptjohjzbbzrfzoadpjyljniagnqwyvgakpcpdcqrydkqilorpmkxtfxi

output:

134

result:

ok single line: '134'

Test #46:

score: 0
Accepted
time: 0ms
memory: 3552kb

input:

qidttrgaramxxxsrjrqiswtbxyclcstuplcwxsoirkghwcdqnwwcztqjumbcoinbqonsclkjidufwrrwvrkuebofwpguuyhvvbhu
qidttrhuouwbvvlakuasfbdfmgreyarepdrtdvjkmpqzjsdbmvhqzoktugphwrsfuinygqzrxkvugnvlmqxptpphbtcrxsdsevex

output:

188

result:

ok single line: '188'

Test #47:

score: 0
Accepted
time: 2ms
memory: 3420kb

input:

atfwqlvfmiuylcjzsatykxonnvonijzfgrnihlszvcnyackkdoqkztdjojzfqbyduopgykzcfoisclzgmsnmzjdzmthsisicxpfp
atfwqlvfmiuylcjzsatykxonnvonijzfgrnihlszvcnyackkdoqkztdjojzfqbyduopgykzcfoisclzgmsnmzjdzmthsisizdsiw

output:

10

result:

ok single line: '10'

Test #48:

score: 0
Accepted
time: 2ms
memory: 3552kb

input:

qiriczgupropmqyiercaartljbjxdpvjhvouxlzsdswellkiodmopmpjnjrifpdcblbafhdfmtctctkouxrtsvuhwtkrzwnsuajq
qiriczgupropmqyiercaartljbjxdpvjhvouxlzsdswellkiodmopmpjnjrifpdcblbafhdfmtctctkouxrtsvuhwtkrzdirdpzz

output:

14

result:

ok single line: '14'

Test #49:

score: 0
Accepted
time: 0ms
memory: 3448kb

input:

tlglfjsjkcddhvqjctqmpawxxwqujcmbtggsovukwlnzmbzafasnxehmkvctrbszcnnueekjncfghdvccpyftbowvdbixqxvhujo
tlglfjsjkcddhvqmakhoduwismlkagjclemeyhrvxyijqwsczxbjxykpsndfacyhohhzfimohmaarfcvupctnzrowdbohpvjyngq

output:

170

result:

ok single line: '170'

Test #50:

score: 0
Accepted
time: 2ms
memory: 3436kb

input:

neguraruzgrnbdqgwrcwwqzngndffnauplttsogytbrjzmqlckhznuchxlnptmizuvxoxhimhnuyvgfjmntzjykdgdauevdkqxvw
neguraruzgrnbdkklnxomjkvqebvclnewqqzurojtzmcqlfegfluosjfdikwkurdshvhkypdunyyijkbafpjbitgjvvwjxorkvqf

output:

172

result:

ok single line: '172'

Test #51:

score: 0
Accepted
time: 1ms
memory: 3548kb

input:

pyzrfnpoeqfcqsgljmeoucdulmkboqlpctltitigkgszzzbyarqvjpqssflhtvayqcfaexxnipgvgpdeujrdrcvyqsazltzqnxsw
pyzrfnpoeqfcqsgljmvzgkuqxnpfkonpjbsxprqryxtphxjedmdxztonxvtdtybdqitiqovdushphchsgrejgvlznfivmxxvjudh

output:

164

result:

ok single line: '164'

Test #52:

score: 0
Accepted
time: 0ms
memory: 3384kb

input:

maotejttipoxllgmtvvgriprulxtxzugfrdkteoabhpnpaubifufjtzwklpooieqgvrhendqbabhoxcxxmynymddfghkueaevavy
maotejttipoxllgmtvvgriprulxtxzeyvpfwfwntzoehnenwsyhcuwvipxxmaooguxkhdmlhgttnfzpzwdxhilkqhwekbwgjbwut

output:

140

result:

ok single line: '140'

Test #53:

score: 0
Accepted
time: 2ms
memory: 3436kb

input:

olmwtsvzfxlxnyhifxwgnegasfhgkrsoabrlelctvcdazhxjsybjhfkrjaukuvthhhmteobujnaposmshirtshqdciiflsvngpsp
olmwtsvzfxlxnyhifxwgnegasfhgkrsoabrlelctvcdazhxjsybjhfkrjaukuvthhhmteozbdmjjcycpimwbkrjafvibqujakqkn

output:

60

result:

ok single line: '60'

Test #54:

score: 0
Accepted
time: 2ms
memory: 3472kb

input:

kbytqqzyggvocrmydptsmhzrhllvkerobzyilihiuhnyagypaztjlcdkbzkwrivdnspufpqbcaeaqhybqhkamegygiubrggpbpxd
kbytqqzyggvocrmydptsmhzrhllvkerobzyilihiuhnyagyqmnxymzphbgoqfwqsnxzvoznygxltmofpgkwjtrrgduvofpekzbrk

output:

106

result:

ok single line: '106'

Test #55:

score: 0
Accepted
time: 2ms
memory: 3416kb

input:

mngdgatzitphdeifmxjeakcrwyloijqzvtinthlaqohuhggkxvwblawywxuwuylthkuxxhhwmtmbnmkpnwrntegopvizybthnxcs
mngdgatzitphdeifmxjeakcrwyloijqzvtinthlaqohuhggnoguxbipmowrkcmtbulsobaylvgvzrmyckvkbksjajcwuccawwjhj

output:

106

result:

ok single line: '106'

Test #56:

score: 0
Accepted
time: 2ms
memory: 3488kb

input:

aulweqlwxavvvktqsqxencbulesrbtwwjnnffgjhkjpattxkaehxryajztckrubvcnakinbwdpmywwppuzlblbbvrsyyptrsgsra
aulweqlwxavvvktqsqxencbulesrbtwwjnnffgjhkjgfxocbirzmiicjskiiqqtpxrfhxoyjxuhyccfzqmnnedjphmvqwykjkoyc

output:

116

result:

ok single line: '116'

Test #57:

score: 0
Accepted
time: 2ms
memory: 3468kb

input:

sjzoadxixulqpqiknmepjzkbupmopxtedxlbfouqiaizhimdacbstoyodxfurvssevdnqvrulotdtnhdwcuskcqindqrpyeuiuim
sjzoadxixulqpqiknmepjzkbupmopxtedxlbfouqiaizhimdacbstoyodxfurvssevdnqvrulotdtnhdwcuskcqindqrpyeuhvtx

output:

8

result:

ok single line: '8'

Test #58:

score: 0
Accepted
time: 2ms
memory: 3552kb

input:

piqgjwrnsntedlackdzhpjycrofbvoartihendryijkiourdbjcjmqnbgpvlcoajvzxklcxnliujfcezlbezpdkmcznieckyjcyf
piqgjwrnsntedlackdzhpjycrofbvoartihendryijkiourdbjcjmqijuykbmzfpkefshmaciakdborfyyvnhtezwdtmltukfjjb

output:

92

result:

ok single line: '92'

Test #59:

score: 0
Accepted
time: 0ms
memory: 3404kb

input:

vcwuglfnxycigrobynhofpfilpezpvasgnbhjreqqdtkbdzlehmitbazuxlnpilfkorstiwdwldvmqzbdhrpteacvumrrziptwkg
vcwuglfnxycigrobynhofpfilpezpvasgnbhbtkaqsffkxoazugayydjyvcanmufpchujuqhtgmfslvrmzatmivchcyofjytmnkf

output:

128

result:

ok single line: '128'

Test #60:

score: 0
Accepted
time: 3ms
memory: 3548kb

input:

kqconagypiyrcqvgkrcahxcsucdsxgqddynbpvkgfqutksevcmqzwuvprvyntnoohthvkyvbfzczyaafsvuzwcimfmrodiiuniws
kqconagypiyrcqvgkrcahxcsucdsxgqddynbpvkgfqutksevcmqzwuvdyrooanlmjfnxqsahdlccthmlsqdaaqzdoroqpqnypdqa

output:

90

result:

ok single line: '90'

Test #61:

score: 0
Accepted
time: 2ms
memory: 3484kb

input:

fqsvqxlghodagjhxqzvfortlqtkddiueqwicpscjotqjmemgzieqevllbsnpcxzkwsmwozjsyhvckiitsywmrszbjpevmeipphxc
fqsvqxlghodagjhxqzvfortlqtkddiukeshdbymgmsokmtgbxxplsvjosuhjrvobwswpplolrsiyaksyfogoqzvdjfapglwenppp

output:

138

result:

ok single line: '138'

Test #62:

score: 0
Accepted
time: 1ms
memory: 3420kb

input:

wbzunsulfcbkxnnhkjsqtlijfeoqqbrtrjuhgdojtjexmwghyevtudgqzjlsiuxzqktkakgjpiznywrzcpflummguplvhfuffuyq
wbzunsulfcbkxnntwlkxchufuukbaoxczlelklfbfskdvtmbweqoqfsiumoqdjzszhqmndmztmbawhssodvihsuugpwsiypebnam

output:

170

result:

ok single line: '170'

Test #63:

score: 0
Accepted
time: 2ms
memory: 3552kb

input:

omiajcqvtjwgjkfqsoggqlnnmfnpwqyxwvqmhyghrpikpdpitsyveunacmgastdcytqhpydfgobdfycgkwwugwviwdjhdtgduvtn
omiajcqvtjwgjkfqsoggqlnnmfnpwqyxwvqmhyghrpikpdpitsyveunacmgastdcytqhpydfgobdfycgkwwugwviwdjflkskjrkh

output:

18

result:

ok single line: '18'

Test #64:

score: 0
Accepted
time: 0ms
memory: 3552kb

input:

fpxieskvlgjvchqdhbpntltzdimfwcvsgjyaqmxqbhsjmxqhjjrdwxfloqloeuxeghvbbphhgsacsgbdpqmgzbancckfmgkumnul
fpxieskbafhzvuobfluavpyyguhbbyydsvmzmzshnxyokpxjhqgdrgqcbdhxbutvjhgokzddgzerihbraobupdruzwuudguyysdv

output:

186

result:

ok single line: '186'

Test #65:

score: 0
Accepted
time: 2ms
memory: 3360kb

input:

xbdic
xbdic

output:

0

result:

ok single line: '0'

Test #66:

score: 0
Accepted
time: 2ms
memory: 3504kb

input:

heamp
heamf

output:

2

result:

ok single line: '2'

Test #67:

score: 0
Accepted
time: 2ms
memory: 3428kb

input:

wapgl
walwg

output:

6

result:

ok single line: '6'

Test #68:

score: 0
Accepted
time: 2ms
memory: 3480kb

input:

hszhn
hszhz

output:

2

result:

ok single line: '2'

Test #69:

score: 0
Accepted
time: 0ms
memory: 3428kb

input:

tmnej
tmgli

output:

6

result:

ok single line: '6'

Test #70:

score: 0
Accepted
time: 2ms
memory: 3512kb

input:

kppkm
ykqag

output:

10

result:

ok single line: '10'

Test #71:

score: 0
Accepted
time: 1ms
memory: 3384kb

input:

gppks
gppkz

output:

2

result:

ok single line: '2'

Test #72:

score: 0
Accepted
time: 2ms
memory: 3376kb

input:

gvbqm
nkisn

output:

10

result:

ok single line: '10'

Test #73:

score: 0
Accepted
time: 2ms
memory: 3432kb

input:

gcydu
gcydt

output:

2

result:

ok single line: '2'

Test #74:

score: 0
Accepted
time: 1ms
memory: 3380kb

input:

poynq
poynq

output:

0

result:

ok single line: '0'

Test #75:

score: 0
Accepted
time: 1ms
memory: 3368kb

input:

xzbbv
xgvkm

output:

8

result:

ok single line: '8'

Test #76:

score: 0
Accepted
time: 2ms
memory: 3508kb

input:

jlalt
finvl

output:

10

result:

ok single line: '10'

Test #77:

score: 0
Accepted
time: 2ms
memory: 3352kb

input:

ygshg
ygkix

output:

6

result:

ok single line: '6'

Test #78:

score: 0
Accepted
time: 2ms
memory: 3384kb

input:

mcglx
mcglx

output:

0

result:

ok single line: '0'

Test #79:

score: 0
Accepted
time: 0ms
memory: 3380kb

input:

jqxpm
jqxpm

output:

0

result:

ok single line: '0'

Test #80:

score: 0
Accepted
time: 1ms
memory: 3380kb

input:

uhxet
uhxhr

output:

4

result:

ok single line: '4'

Test #81:

score: 0
Accepted
time: 2ms
memory: 3356kb

input:

icsxd
icsxk

output:

2

result:

ok single line: '2'

Test #82:

score: 0
Accepted
time: 2ms
memory: 3508kb

input:

aibsz
exshe

output:

10

result:

ok single line: '10'

Test #83:

score: 0
Accepted
time: 2ms
memory: 3432kb

input:

xdmjt
zhpnl

output:

10

result:

ok single line: '10'

Test #84:

score: 0
Accepted
time: 0ms
memory: 3380kb

input:

fczhg
hlmnq

output:

10

result:

ok single line: '10'

Test #85:

score: 0
Accepted
time: 2ms
memory: 3508kb

input:

mbtnh
mbtds

output:

4

result:

ok single line: '4'