QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#502856#8252. Tip of Your Tonguexiaowuc1AC ✓204ms250168kbC++172.9kb2024-08-03 15:17:222024-08-03 15:17:27

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3624kb

input:

4 4
cat
catcat
octal
occidental
AND cat cat
OR oc at
AND ca at
XOR oc al

output:

2
4
2
0

result:

ok 4 lines

Test #2:

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

input:

26 36
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
AND b b
AND d d
XOR tk ce
AND w w
AND z z
XOR t t
OR a a
OR s s
AND p p
AND v v
AND pp kh
XOR j j
AND n n
OR f f
XOR vo mj
OR m m
XOR q q
XOR r r
AND i i
OR l l
OR jb cg
XOR x x
XOR nf ov
OR e e
XOR h h
XOR u u
XOR c c
OR y y
XOR nc ln
AND o ...

output:

1
1
0
1
1
0
1
1
1
1
0
0
1
1
0
1
0
0
1
1
0
0
0
1
0
0
0
1
0
1
0
0
0
0
1
1

result:

ok 36 lines

Test #3:

score: 0
Accepted
time: 29ms
memory: 47016kb

input:

18 18
a
ab
abba
abbabaab
abbabaabbaababba
abbabaabbaababbabaababbaabbabaab
abbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababba
abbabaabbaababbabaababbaabbabaabbaababbaabbabaababbabaabbaababbabaababbaabbabaababbabaabbaababbaabbabaabbaababbabaababbaabbabaab
abbabaabbaababbabaababbaabbabaa...

output:

18
17
8
8
14
7
6
11
10
5
4
3
3
2
2
0
1
0

result:

ok 18 lines

Test #4:

score: 0
Accepted
time: 102ms
memory: 250168kb

input:

1 1
ocyzfhhambhirbkeodnshorawhzsqakgywcadicyacxleobjmjrbgqrdqqvqecccxuahrkwnimglrcmiaujynldydopyasdbefpxmagfquhzrtfnuikojwpjocjwrogxhrquqruqqsunsjotsgeetddviaoswcavdswftyheurrclunactnwqhnqzrxjlsipyxxmmeiwxawqzvhtcmmadyvfzrhinphlibltwartaczraqkaaljefkksbawqmnsbquqxpbneshiuypfafihqtehavpdsoauwyvsqblxo...

output:

0

result:

ok single line: '0'

Test #5:

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

input:

1 1
a
OR zxuxomuitrpatgdidwnuxfrwultbimmesgzkgcdsvjzmanhyebwdzowthmiqlsagxoqvyciyslmoxvceppnkjuvzhszgcdnpmdqxhbinbknbbzfcnhizysyeaemkpeandwqutpmnxytmnkzfghmptiqnppuwndlxlhpimvmsaytdycezpodqcbddybswutmimtpgzhmijvpphelairwewqshektuldufwxuzirjkpemoafnpopqfgxefcxuzgbbhehfpbmkdqbxsdejspcydluchncbhbfghoys...

output:

0

result:

ok single line: '0'

Test #6:

score: 0
Accepted
time: 51ms
memory: 71932kb

input:

250 50000
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

1
250
249
1
1
1
1
250
250
1
1
250
249
1
1
249
250
250
1
250
250
1
249
1
1
249
1
1
1
250
249
250
250
250
250
1
250
249
249
249
1
250
1
250
249
249
250
249
250
250
1
250
250
250
250
250
1
1
249
249
250
1
1
250
1
250
249
250
1
249
1
249
1
249
1
1
1
250
250
249
249
250
250
1
250
249
250
1
1
250
1
250
25...

result:

ok 50000 lines

Test #7:

score: 0
Accepted
time: 32ms
memory: 79512kb

input:

10 10
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

10
10
0
10
10
10
10
0
0
10

result:

ok 10 lines

Test #8:

score: 0
Accepted
time: 100ms
memory: 51420kb

input:

10000 40000
lhheuleivzyldlchherj
phgmehaliwwulthedmop
ifszbvkgywuyemcxbvns
wycojxbttxudiiclvgvk
camfcfwvxlvyoyfyqsci
zqkxtcfhovfemzizxhev
ugbsvnxratulswilmekh
cvveyzynvzgnfukgorio
lsstnqurowhzvvzmvhwh
crhuqauvnvwdeyqlxchi
xvbybzkvzkjntwtdiglt
ylgvjsugwaicedszzhlv
jyswsdydzgicxheoqjfh
jnbmcjgbyfmxyae...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

result:

ok 40000 lines

Test #9:

score: 0
Accepted
time: 144ms
memory: 171564kb

input:

40000 10000
lynhbrgdcbqmazwibcti
xxbyaqngttjaadowpoxd
jyxvinberwqbykawbyvf
vayqjzfyjlvzsuwwrsvs
lukgakfkiiaxuedhtzpx
uwhoadeqqzhkwggfebkj
uyfreqcgwgtqvqlwitzf
zajebujpbhufhvyowsbh
sbnvcyswptsbbdvdxsxl
oozymjrfnjogbxlbptbw
vlxvuhfueomwhmjcddlc
szffcnpiwpgrymdqimnp
cesclsyvliesdrhoulim
ceryoczqhltomnm...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

result:

ok 10000 lines

Test #10:

score: 0
Accepted
time: 119ms
memory: 112276kb

input:

25000 25000
vdyrdfobpnmzkafujwav
sejhjjarcfatdrxcdhxg
tgvgnooftnykcynfbyxs
xtzqsasggmfouxwbsnhz
npwdngyaxjblnlqvgiqu
ivcevcmhsezxcqyhihvt
ilrztetzikmehuztbghe
vosgdubogglelqdgjsyf
gagqyoscjfirtpsdpcjy
wdrhtcvbelqkxxiymjif
iukqdbdggkpjftahbsuq
huvznzywxqpmpfnrjgkc
ieezfelxxquvridxswbl
vhtrgplvqgewjhk...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

result:

ok 25000 lines

Test #11:

score: 0
Accepted
time: 204ms
memory: 101036kb

input:

50000 50000
fhbzhhsbzj
iplzfbimxp
plobcikqkd
amxzydjuwi
xiublxnnoi
cpnwnulhjz
cpspkovuot
dvkiqopibs
deehvpeijn
cueklrdhay
ubcoawbhvd
irzkcpnyhv
yehoeolcbq
shxsfaekgn
ynqdlcblvc
avexwjuolf
oabfylgpjm
xkkqgisphg
jiokzejjof
ryobskxxtu
rotajeixrg
ctvimviwgz
smbimudyle
olnerzqovj
woslasgtbg
pewowwuuth
th...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

result:

ok 50000 lines

Test #12:

score: 0
Accepted
time: 101ms
memory: 191992kb

input:

20 20
gddaatgysreztfnjttlpsfhskbxjqltiokdxifltzipusrztchtejvziswzynfyytotyefjuseowxnakvzvzecyfxstsbtegvmtzjsdaixnnjvoyrqfmvnqcgiqznzzyosolumqhzuhknstpsindhxfctphufyebubprvlxoqmtfsbcnehyjewncdmiyxxrotihfxvdkinwtbtfqyncrypmbrbevsvofswrfvcuzcpwdaxsxjqgluuvvsteaobdlnlwboswqmvbexhpxzmktadrtwvcsdpfyluwhht...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

result:

ok 20 lines

Test #13:

score: 0
Accepted
time: 56ms
memory: 121232kb

input:

20 20
vieddzryrbrgvezcrdvtfujyllhusrcemmxlarpmwccaeuvjnxecjxyxhhilaiyqtisyxxtfjnlzvepxiivavycywkkxdrmifgxggcupbbkvlymnrrvfaauoxieymchvdyravgowdvaoqjnbojfpgmtieydackvuruzhnmcblxlmiauyrpmbntnejwprfoeylbpzrpnjoqxpafdkfrnhfcjtbzpekpxfnwvjkpnvdlfbvrblsysybxpeonxwaqaiuqswbfialryoxezgoijbktvrisrrgrndkmtibl...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

result:

ok 20 lines

Test #14:

score: 0
Accepted
time: 54ms
memory: 121716kb

input:

10 10
fxbapnhzxqgypinkcwvcdffncpofscfumrhdywwsndelaxgwwintmtrbwbfkmycuuofnpkxusaxushqptczpkvjzutdgjbjubkvwopzvduvinmixbozzyuwnozuwemctztrcyqdwqejqbnvrsuhoherqgjdxctzfrdzysinwauupiealofgezefjzubjycpxswstyqcohmllwtfmrdtqakfgopirtyjlwniezmllpfcwloczdfgtwkxumffysdtpiclykobzoqqzprsjqjjfkcuaeokdxhhqgnxjpb...

output:

0
0
0
0
0
0
0
0
0
0

result:

ok 10 lines

Test #15:

score: 0
Accepted
time: 81ms
memory: 75464kb

input:

20000 15000
ycpcujwskbndpkstgaznlbryxji
ycpcujwskbdseynvaaznlbryxji
ycpcujwskbygsrainaznlbryxji
ycpcujwskbnatcrctaznlbryxji
ycpcujwskbkaxnsymaznlbryxji
ycpcujwskbtpqpibsaznlbryxji
ycpcujwskbhmudkxraznlbryxji
ycpcujwskbueqmfflaznlbryxji
ycpcujwskbfkeudapaznlbryxji
ycpcujwskbjxnhhhsaznlbryxji
ycpcujws...

output:

20000
20000
20000
20000
20000
20000
20000
20000
20000
20000
20000
20000
20000
20000
20000
20000
20000
20000
20000
20000
20000
20000
20000
20000
20000
20000
20000
20000
20000
20000
20000
20000
20000
20000
20000
20000
20000
20000
20000
20000
20000
20000
20000
20000
20000
20000
20000
20000
20000
20000
...

result:

ok 15000 lines

Test #16:

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

input:

10 2700
jmldwyxnouejzaqmujxahyissokibdqbgvqzauolmrjbzuibrkncaxfeepypxavmwqfntjzqszisvunypogzuiczxiaqkjlyzhmzirbnrsibwgyiqbvdqfccztiepuihkdqutzoctwnxfgixmawyyldzxrrtclpujhywsyidnetozusfvsfyrhfqfhufvlcwfwovdrlkczeinjygyjlijrygjplsssqhobmxdrgotnmwwwekgompkmfwjmvwgcsfrmmmlybrwcgnbsbxwpthpuwynlefetsygzln...

output:

10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
...

result:

ok 2700 lines

Test #17:

score: 0
Accepted
time: 5ms
memory: 5548kb

input:

10 2700
otckkjfmnhodtkatewfpeyxqurahqazyormsrsxhdioocfgslbxyzcnbiyvsgfxpfqcxkifjnzfuvhpytvyzqhnspltgahsczsnhdwbgwtfwjdhyisufyqupenclrlxwebpipopfmbpdjwelmiiocjddgyihlomaetukpbxxqpvjvqkfhupzhwdwdyshekxagurryjzaealcvqsomigcihlxtlgbiyutuqskwoofnqofgzkkgoncmkhjgijtlxfjewsampxorudxhlctcfspudtkrhnyexcyeoli...

output:

10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
...

result:

ok 2700 lines