QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#347639#8070. A Complex ProblemZhangYiDeAC ✓128ms24584kbC++202.5kb2024-03-09 14:40:002024-03-09 14:40:01

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

6 2
A B
B C
C A
A D
D E
E A
F B
E G

output:

3 3

result:

ok single line: '3 3'

Test #2:

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

input:

1 0
P NP

output:

1 2

result:

ok single line: '1 2'

Test #3:

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

input:

0 1
R ALL

output:

2 2

result:

ok single line: '2 2'

Test #4:

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

input:

3 0
QMIP MIPstar
MIPstar RE
RE QMIP

output:

1 1

result:

ok single line: '1 1'

Test #5:

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

input:

11 8
NC P
P BPP
P coNP
P NP
BPP BQP
coNP PSPACE
BQP PSPACE
NP PSPACE
PSPACE EXPTIME
EXPTIME NEXPTIME
NEXPTIME EXPSPACE
REG CFL
CFL NC
CFL CSL
NC PSPACE
CSL PSPACE
EXPSPACE R
R RE
RE ALL

output:

7 16

result:

ok single line: '7 16'

Test #6:

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

input:

5 4
A B
E B
B G
H C
E G
A D
D E
G H
B C

output:

4 7

result:

ok single line: '4 7'

Test #7:

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

input:

6 3
B G
H C
E B
B C
A D
A B
D E
G H
E G

output:

4 7

result:

ok single line: '4 7'

Test #8:

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

input:

5 4
B C
A B
A D
E G
H C
B G
D E
G H
E B

output:

5 7

result:

ok single line: '5 7'

Test #9:

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

input:

23 6
AA AB
AB AC
AC AD
AC AM
AD ADB
ADB ADC
ADC ADD
ADC AE
ADD AD
AN ADD
ADD AE
AE AH
AE AF
AF AG
AG AH
AH AI
AI ADC
AI AJ
AJ ADB
AJ AC
AJ AK
AK AL
AK AA
AG BF
AH BE
AI BD
AJ BC
AK BB
AA BA

output:

2 10

result:

ok single line: '2 10'

Test #10:

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

input:

6 3
B G
H C
E B
B C
A D
A B
D E
G H
E H

output:

3 7

result:

ok single line: '3 7'

Test #11:

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

input:

50 2
AA AB
AB AC
AC AD
AC AM
AD ADB
ADB ADC
ADC ADD
ADC AE
ADD AD
AN ADD
ADD AE
AE AH
AE AF
AF AG
AG AH
AH AI
AI ADC
AI AJ
AJ ADB
AJ AC
AJ AK
AK AL
AK AA
AG BF
AH BE
AI BD
AJ BC
AK BB
BA BB
BB BC
BC BD
BD BE
BE BF
BA CA
BB CB
BC CC
BD CD
BE CE
CA CZA
CZA CB
CB CZB
CZB CC
CC CZC
CZC CD
CD CZD
CZD CE
...

output:

3 11

result:

ok single line: '3 11'

Test #12:

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

input:

23 12
AA AB
AB AC
AC AD
AC AM
AD ADB
ADB ADC
ADC ADD
ADC AE
ADD AD
AN ADD
ADD AE
AE AH
AE AF
AF AG
AG AH
AH AI
AI ADC
AI AJ
AJ ADB
AJ AC
AJ AK
AK AL
AK AA
AG BF
AH BE
AI BD
AJ BC
AK BB
AA BA
BA CA
BB CB
BC CC
BD CD
BE CE
BF CF

output:

3 16

result:

ok single line: '3 16'

Test #13:

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

input:

33 12
AA AB
AB AC
AC AD
AC AM
AD ADB
ADB ADC
ADC ADD
ADC AE
ADD AD
AN ADD
ADD AE
AE AH
AE AF
AF AG
AG AH
AH AI
AI ADC
AI AJ
AJ ADB
AJ AC
AJ AK
AK AL
AK AA
CF CE
CE CD
CD CC
CC CB
CB CA
CA CF
CA CXA
CB CXB
CC CXC
CD CXD
AG BF
AH BE
AI BD
AJ BC
AK BB
AA BA
BA CA
BB CB
BC CC
BD CD
BE CE
BF CF

output:

3 15

result:

ok single line: '3 15'

Test #14:

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

input:

51 2
BF BA
AA AB
AB AC
AC AD
AC AM
AD ADB
ADB ADC
ADC ADD
ADC AE
ADD AD
AN ADD
ADD AE
AE AH
AE AF
AF AG
AG AH
AH AI
AI ADC
AI AJ
AJ ADB
AJ AC
AJ AK
AK AL
AK AA
AG BF
AH BE
AI BD
AJ BC
AK BB
BA BB
BB BC
BC BD
BD BE
BE BF
BA CA
BB CB
BC CC
BD CD
BE CE
CA CZA
CZA CB
CB CZB
CZB CC
CC CZC
CZC CD
CD CZD
C...

output:

3 6

result:

ok single line: '3 6'

Test #15:

score: 0
Accepted
time: 49ms
memory: 11144kb

input:

0 47356
fpo axqt
yhk axqy
bbq aliw
arbj sol
abau addo
ufv bbqr
bakb acn
ofb ods
bdge bebp
vhp afqc
ysv zyp
adfw asfm
fcz aygg
bdkx msx
ajwv avsz
agdd bnwv
niq muj
agrl bhrp
aggr aces
oot bmum
acmy anjr
apq hyi
bduj pxy
bmzk smz
bnxq aqzj
aycy pzf
akzu mbx
fly aegu
asff avrf
aeup aufq
bpdp wbj
alnr b...

output:

683 47362

result:

ok single line: '683 47362'

Test #16:

score: 0
Accepted
time: 58ms
memory: 14044kb

input:

47356 0
fpo axqt
yhk axqy
bbq aliw
arbj sol
abau addo
ufv bbqr
bakb acn
ofb ods
bdge bebp
vhp afqc
ysv zyp
adfw asfm
fcz aygg
bdkx msx
ajwv avsz
agdd bnwv
niq muj
agrl bhrp
aggr aces
oot bmum
acmy anjr
apq hyi
bduj pxy
bmzk smz
bnxq aqzj
aycy pzf
akzu mbx
fly aegu
asff avrf
aeup aufq
bpdp wbj
alnr b...

output:

1 47362

result:

ok single line: '1 47362'

Test #17:

score: 0
Accepted
time: 128ms
memory: 23884kb

input:

100000 0
cdqe ejba
bcsv bkdt
lxf brsz
dzcc agoy
dbpu celu
bsep ssh
lyo bdyw
awsx cpiu
csfq buwz
eatm yau
efed bfuf
awnu akit
cyfr fae
dosg bhcy
ajku dkrd
azpu bqkt
ejqb cxoq
cjgi dbaj
fvm aacx
szn kuz
eeuz bwkq
wtr aysi
aupe dvwr
ctny cxad
dqld bamg
diga cfzw
edav dscq
dkfp airu
bhlg aamx
bmb ckff
d...

output:

1 1

result:

ok single line: '1 1'

Test #18:

score: 0
Accepted
time: 90ms
memory: 19524kb

input:

0 100000
czlz bbt
aufs czlz
douo aufs
bkhi douo
blbx bkhi
edtk blbx
dhxd edtk
asqe dhxd
agba asqe
ues agba
bddp ues
crbj bddp
elkb crbj
dirt elkb
aowe dirt
ckpg aowe
eijf ckpg
all eijf
bysm all
atnq bysm
dzjm atnq
dkwn dzjm
allz dkwn
agur allz
eabq agur
dhzn eabq
ady dhzn
dwdv ady
ecgy dwdv
bzqc ecg...

output:

100001 100001

result:

ok single line: '100001 100001'

Test #19:

score: 0
Accepted
time: 121ms
memory: 19740kb

input:

0 100000
cdqe ejba
bcsv bkdt
lxf brsz
dzcc agoy
dbpu celu
bsep ssh
lyo bdyw
awsx cpiu
csfq buwz
eatm yau
efed bfuf
awnu akit
cyfr fae
dosg bhcy
ajku dkrd
azpu bqkt
ejqb cxoq
cjgi dbaj
fvm aacx
szn kuz
eeuz bwkq
wtr aysi
aupe dvwr
ctny cxad
dqld bamg
diga cfzw
edav dscq
dkfp airu
bhlg aamx
bmb ckff
d...

output:

100001 100001

result:

ok single line: '100001 100001'

Test #20:

score: 0
Accepted
time: 105ms
memory: 22180kb

input:

50000 50000
czlz bbt
aufs czlz
douo aufs
bkhi douo
blbx bkhi
edtk blbx
dhxd edtk
asqe dhxd
agba asqe
ues agba
bddp ues
crbj bddp
elkb crbj
dirt elkb
aowe dirt
ckpg aowe
eijf ckpg
all eijf
bysm all
atnq bysm
dzjm atnq
dkwn dzjm
allz dkwn
agur allz
eabq agur
dhzn eabq
ady dhzn
dwdv ady
ecgy dwdv
bzqc ...

output:

50001 100001

result:

ok single line: '50001 100001'

Test #21:

score: 0
Accepted
time: 98ms
memory: 19364kb

input:

0 100000
dahl ajsb
ajsb bkxw
bkxw dznl
dznl acdb
acdb enuu
enuu chdh
chdh log
log cell
cell efjs
efjs rov
rov ckig
ckig airh
airh cayq
cayq csff
csff buhl
buhl aioq
aioq emtc
emtc hyi
hyi angs
angs dmwb
dmwb djrm
djrm dxru
dxru chnz
chnz bhbc
bhbc clhh
clhh dlcj
dlcj aaoz
aaoz bhua
bhua chfz
chfz br...

output:

100001 100001

result:

ok single line: '100001 100001'

Test #22:

score: 0
Accepted
time: 115ms
memory: 24584kb

input:

100000 0
czlz bbt
aufs czlz
douo aufs
bkhi douo
blbx bkhi
edtk blbx
dhxd edtk
asqe dhxd
agba asqe
ues agba
bddp ues
crbj bddp
elkb crbj
dirt elkb
aowe dirt
ckpg aowe
eijf ckpg
all eijf
bysm all
atnq bysm
dzjm atnq
dkwn dzjm
allz dkwn
agur allz
eabq agur
dhzn eabq
ady dhzn
dwdv ady
ecgy dwdv
bzqc ecg...

output:

1 100001

result:

ok single line: '1 100001'

Test #23:

score: 0
Accepted
time: 94ms
memory: 22716kb

input:

39608 39609
bdaz fomw
ddot qti
aaly cjxp
bxct adda
cavr akld
azdz auni
mp auqz
tdb evul
bpre czfn
cnqh cduh
aezr bizk
biuo bkpg
bfsy fudf
bgkl fxe
diup bxyr
bpja drnk
dhta eme
byth acnj
dbjj dnqv
bixo czul
tse aetq
cujn fsza
mrh ezsz
sro cxfs
adle etja
aril frsj
adqz bbig
aifp dqre
eyo egfn
acew ecu...

output:

15 99080

result:

ok single line: '15 99080'

Test #24:

score: 0
Accepted
time: 42ms
memory: 11644kb

input:

19263 19262
pen aao
riv xms
mrj bdb
alzx auaj
xjj aanl
akig agfa
nzn agpa
aajh jfa
tdt azcj
jzl amzi
rmw gpp
jxp gdq
rlw jbx
dhh baml
lzx muw
wvw aapf
aedj pnc
aacq cir
azlt gtr
taz bdvu
aqel pkj
aejx tah
ls qx
nkd qmz
est qlf
bdek anpj
neh aphm
xlt abjv
auio gxe
ajka pxc
adbt bbis
htj elg
tvt cgu
r...

output:

171 38845

result:

ok single line: '171 38845'