Submission details
Task:LibBot
Sender:aalto25b_008
Submission time:2025-09-10 17:20:42 +0300
Language:Python2 (PyPy2)
Status:READY
Result:
Test results
testverdicttime
#10.05 sdetails
#20.05 sdetails
#30.04 sdetails
#40.05 sdetails
#50.05 sdetails
#60.05 sdetails
#70.05 sdetails
#80.05 sdetails
#90.05 sdetails
#100.05 sdetails
#110.05 sdetails
#120.05 sdetails
#130.05 sdetails
#140.04 sdetails
#150.04 sdetails
#160.05 sdetails
#170.05 sdetails
#180.04 sdetails
#190.05 sdetails
#200.04 sdetails
#210.04 sdetails
#220.05 sdetails
#230.05 sdetails
#240.05 sdetails
#250.04 sdetails
#260.05 sdetails
#270.05 sdetails
#280.05 sdetails
#290.05 sdetails
#300.04 sdetails
#310.04 sdetails
#320.05 sdetails
#330.04 sdetails
#340.05 sdetails
#350.05 sdetails
#360.04 sdetails
#370.04 sdetails
#380.05 sdetails
#390.05 sdetails
#400.04 sdetails
#410.04 sdetails

Code

size = int(input().split(" ")[1])
bookName = input().split(" ")[1]

def posToStr(pos):
    return f"{1+(pos//size**4)}.{1+(pos//size**3) %size}.{1+(pos//size**2) %size}.{1+(pos//size**1) %size}.{1+(pos%size)}"


interFace = ""
debug = False
def ask(mid):
    if debug:
        global interFace

        myMi = 3
        myMa = 6
        if myMi < mid and mid < myMa:
            interFace = "abc"
            print
        elif myMi >= mid:
            interFace = "abb"
        else:
            interFace = "abd"
    else:
        print("FETCH", posToStr(mid))
def getInput():
    if debug:
        global interFace
        found = interFace
    else:
        found = input().split(" ")[1]
    return found

def minBound():
    maxPos = size**5
    minPos = 0
    while True:
        mid = (minPos+maxPos)//2
        # ask(mid)
        # found = getInput()
        found = input(f"FETCH {posToStr(mid)}").split(" ")[1]
        if maxPos - minPos < 2:
            return maxPos
        if found >= bookName:
            maxPos = mid
        elif found < bookName:
            minPos = mid


def maxBound():
    maxPos = size**5
    minPos = 0
    while True:
        mid = (minPos+maxPos)//2
        # ask(mid)
        # found = getInput()
        found = input(f"FETCH {posToStr(mid)}").split(" ")[1]

        if maxPos - minPos < 2:
            return maxPos
        if found > bookName:
            maxPos = mid
        elif found <= bookName:
            minPos = mid

ma = maxBound()
# print("---")
mi = minBound()
print("GOT", ma-mi)

Test details

Test 1

Verdict:

input
2 9
kdg
dl 6
kdg 3
kdgwl 1
...

correct output
(empty)

user output
SIZE 2
COUNT kdg

Error:
1 1 0 1

Test 2

Verdict:

input
3 15
irwkfl
c 26
d 27
e 11
...

correct output
(empty)

user output
SIZE 3
COUNT irwkfl

Error:
1 1 0 1

Test 3

Verdict:

input
4 34
gcnmkobrd
bcytu 60
bheb 64
bhebp 26
...

correct output
(empty)

user output
SIZE 4
COUNT gcnmkobrd

Error:
1 1 0 1

Test 4

Verdict:

input
5 52
faoluuicsn
a 1
cufqs 30
d 44
...

correct output
(empty)

user output
SIZE 5
COUNT faoluuicsn

Error:
1 1 0 1

Test 5

Verdict:

input
6 75
okokxlluuicsnw
a 1
b 51
bxcufq 145
...

correct output
(empty)

user output
SIZE 6
COUNT okokxlluuicsnw

Error:
1 1 0 1

Test 6

Verdict:

input
7 105
jibgewnvmqnpbxvirxmgf
a 1
aqykhme 32
atusxwa 119
...

correct output
(empty)

user output
SIZE 7
COUNT jibgewnvmqnpbxvirxmgf

Error:
1 1 0 1

Test 7

Verdict:

input
8 124
djnofmgdbfj
afpc 66
apj 204
apjgsu 105
...

correct output
(empty)

user output
SIZE 8
COUNT djnofmgdbfj

Error:
1 1 0 1

Test 8

Verdict:

input
9 166
qonvyqgibutxey
a 94
act 683
afngrwb 20
...

correct output
(empty)

user output
SIZE 9
COUNT qonvyqgibutxey

Error:
1 1 0 1

Test 9

Verdict:

input
10 211
zuek
axof 303
axofdxjyeevjxifd 397
axofvxnleg 539
...

correct output
(empty)

user output
SIZE 10
COUNT zuek

Error:
1 1 0 1

Test 10

Verdict:

input
10 216
hskapswvzfrbijqwgotkothu
aayuulyq 436
aayuulyqcs 205
aayuulyqcsgjqffbfix 530
...

correct output
(empty)

user output
SIZE 10
COUNT hskapswvzfrbijqwgotkothu

Error:
1 1 0 1

Test 11

Verdict:

input
9 158
ylhjecnhgyboje
a 691
acd 241
apkcczfzzxrpvlk 88
...

correct output
(empty)

user output
SIZE 9
COUNT ylhjecnhgyboje

Error:
1 1 0 1

Test 12

Verdict:

input
8 133
ewcm
aavhwtselm 486
aavrwtsejm 170
aayuuly 62
...

correct output
(empty)

user output
SIZE 8
COUNT ewcm

Error:
1 1 0 1

Test 13

Verdict:

input
7 98
jkpxbvb
awb 326
comccswxez 114
cw 42
...

correct output
(empty)

user output
SIZE 7
COUNT jkpxbvb

Error:
1 1 0 1

Test 14

Verdict:

input
6 70
eaymki
alkio 119
alkioruv 72
alkioruvyivod 26
...

correct output
(empty)

user output
SIZE 6
COUNT eaymki

Error:
1 1 0 1

Test 15

Verdict:

input
4 28
unje
biybsjet 60
biybsjetnn 27
bx 45
...

correct output
(empty)

user output
SIZE 4
COUNT unje

Error:
1 1 0 1

Test 16

Verdict:

input
9 159
ckfhsouqxvv
a 373
aahay 152
asvvihxxokcevotlncilqbuvhmdkmh...

correct output
(empty)

user output
SIZE 9
COUNT ckfhsouqxvv

Error:
1 1 0 1

Test 17

Verdict:

input
8 117
h
aaha 262
anmuhfjbetlfzdbns 107
awhfbhdbjbuexgbwl 226
...

correct output
(empty)

user output
SIZE 8
COUNT h

Error:
1 1 0 1

Test 18

Verdict:

input
7 106
m
aezpq 42
aokpn 7
aqfkfe 86
...

correct output
(empty)

user output
SIZE 7
COUNT m

Error:
1 1 0 1

Test 19

Verdict:

input
7 101
kvtwj
appvlr 240
bguzpylrzkwon 78
bofd 2
...

correct output
(empty)

user output
SIZE 7
COUNT kvtwj

Error:
1 1 0 1

Test 20

Verdict:

input
2 9
fu
dl 6
kdg 3
kdgwl 1
...

correct output
(empty)

user output
SIZE 2
COUNT fu

Error:
1 1 0 1

Test 21

Verdict:

input
3 15
uvk
c 26
d 27
e 11
...

correct output
(empty)

user output
SIZE 3
COUNT uvk

Error:
1 1 0 1

Test 22

Verdict:

input
4 34
jgtx
bcytu 60
bheb 64
bhebp 26
...

correct output
(empty)

user output
SIZE 4
COUNT jgtx

Error:
1 1 0 1

Test 23

Verdict:

input
5 52
ghmfq
a 1
cufqs 30
d 44
...

correct output
(empty)

user output
SIZE 5
COUNT ghmfq

Error:
1 1 0 1

Test 24

Verdict:

input
6 75
ojuphd
a 1
b 51
bxcufq 145
...

correct output
(empty)

user output
SIZE 6
COUNT ojuphd

Error:
1 1 0 1

Test 25

Verdict:

input
7 105
kzzqfzz
a 1
aqykhme 32
atusxwa 119
...

correct output
(empty)

user output
SIZE 7
COUNT kzzqfzz

Error:
1 1 0 1

Test 26

Verdict:

input
8 124
emdxvwdw
afpc 66
apj 204
apjgsu 105
...

correct output
(empty)

user output
SIZE 8
COUNT emdxvwdw

Error:
1 1 0 1

Test 27

Verdict:

input
9 166
pkhsbasuj
a 94
act 683
afngrwb 20
...

correct output
(empty)

user output
SIZE 9
COUNT pkhsbasuj

Error:
1 1 0 1

Test 28

Verdict:

input
10 211
zypqadmqoo
axof 303
axofdxjyeevjxifd 397
axofvxnleg 539
...

correct output
(empty)

user output
SIZE 10
COUNT zypqadmqoo

Error:
1 1 0 1

Test 29

Verdict:

input
10 216
jhagispreh
aayuulyq 436
aayuulyqcs 205
aayuulyqcsgjqffbfix 530
...

correct output
(empty)

user output
SIZE 10
COUNT jhagispreh

Error:
1 1 0 1

Test 30

Verdict:

input
9 158
zfkmqpzht
a 691
acd 241
apkcczfzzxrpvlk 88
...

correct output
(empty)

user output
SIZE 9
COUNT zfkmqpzht

Error:
1 1 0 1

Test 31

Verdict:

input
8 133
dogiavnu
aavhwtselm 486
aavrwtsejm 170
aayuuly 62
...

correct output
(empty)

user output
SIZE 8
COUNT dogiavnu

Error:
1 1 0 1

Test 32

Verdict:

input
7 98
kihqiff
awb 326
comccswxez 114
cw 42
...

correct output
(empty)

user output
SIZE 7
COUNT kihqiff

Error:
1 1 0 1

Test 33

Verdict:

input
6 70
eszubi
alkio 119
alkioruv 72
alkioruvyivod 26
...

correct output
(empty)

user output
SIZE 6
COUNT eszubi

Error:
1 1 0 1

Test 34

Verdict:

input
4 28
vyta
biybsjet 60
biybsjetnn 27
bx 45
...

correct output
(empty)

user output
SIZE 4
COUNT vyta

Error:
1 1 0 1

Test 35

Verdict:

input
9 159
ctohjykey
a 373
aahay 152
asvvihxxokcevotlncilqbuvhmdkmh...

correct output
(empty)

user output
SIZE 9
COUNT ctohjykey

Error:
1 1 0 1

Test 36

Verdict:

input
8 117
igjxpndn
aaha 262
anmuhfjbetlfzdbns 107
awhfbhdbjbuexgbwl 226
...

correct output
(empty)

user output
SIZE 8
COUNT igjxpndn

Error:
1 1 0 1

Test 37

Verdict:

input
7 106
lslhnht
aezpq 42
aokpn 7
aqfkfe 86
...

correct output
(empty)

user output
SIZE 7
COUNT lslhnht

Error:
1 1 0 1

Test 38

Verdict:

input
7 101
hxliesh
appvlr 240
bguzpylrzkwon 78
bofd 2
...

correct output
(empty)

user output
SIZE 7
COUNT hxliesh

Error:
1 1 0 1

Test 39

Verdict:

input
2 1
fu
dl 32

correct output
(empty)

user output
SIZE 2
COUNT fu

Error:
1 1 0 1

Test 40

Verdict:

input
3 1
fuuicsxvc
fuuicsxvc 243

correct output
(empty)

user output
SIZE 3
COUNT fuuicsxvc

Error:
1 1 0 1

Test 41

Verdict:

input
4 1
bcytu
bcytu 1024

correct output
(empty)

user output
SIZE 4
COUNT bcytu

Error:
1 1 0 1