Submission details
Task:LibBot
Sender:aalto25b_008
Submission time:2025-09-10 17:21:00 +0300
Language:Python3 (PyPy3)
Status:READY
Result:
Test results
testverdicttime
#1--details
#2--details
#3--details
#4--details
#5--details
#6--details
#7--details
#8--details
#9--details
#10--details
#11--details
#12--details
#13--details
#14--details
#15--details
#16--details
#17--details
#18--details
#19--details
#20--details
#21--details
#22--details
#23--details
#24--details
#25--details
#26--details
#27--details
#28--details
#29--details
#30--details
#31--details
#32--details
#33--details
#34--details
#35--details
#36--details
#37--details
#38--details
#39--details
#40--details
#41--details

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
(empty)

Test 2

Verdict:

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

correct output
(empty)

user output
(empty)

Test 3

Verdict:

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

correct output
(empty)

user output
(empty)

Test 4

Verdict:

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

correct output
(empty)

user output
(empty)

Test 5

Verdict:

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

correct output
(empty)

user output
(empty)

Test 6

Verdict:

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

correct output
(empty)

user output
(empty)

Test 7

Verdict:

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

correct output
(empty)

user output
(empty)

Test 8

Verdict:

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

correct output
(empty)

user output
(empty)

Test 9

Verdict:

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

correct output
(empty)

user output
(empty)

Test 10

Verdict:

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

correct output
(empty)

user output
(empty)

Test 11

Verdict:

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

correct output
(empty)

user output
(empty)

Test 12

Verdict:

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

correct output
(empty)

user output
(empty)

Test 13

Verdict:

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

correct output
(empty)

user output
(empty)

Test 14

Verdict:

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

correct output
(empty)

user output
(empty)

Test 15

Verdict:

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

correct output
(empty)

user output
(empty)

Test 16

Verdict:

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

correct output
(empty)

user output
(empty)

Test 17

Verdict:

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

correct output
(empty)

user output
(empty)

Test 18

Verdict:

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

correct output
(empty)

user output
(empty)

Test 19

Verdict:

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

correct output
(empty)

user output
(empty)

Test 20

Verdict:

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

correct output
(empty)

user output
(empty)

Test 21

Verdict:

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

correct output
(empty)

user output
(empty)

Test 22

Verdict:

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

correct output
(empty)

user output
(empty)

Test 23

Verdict:

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

correct output
(empty)

user output
(empty)

Test 24

Verdict:

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

correct output
(empty)

user output
(empty)

Test 25

Verdict:

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

correct output
(empty)

user output
(empty)

Test 26

Verdict:

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

correct output
(empty)

user output
(empty)

Test 27

Verdict:

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

correct output
(empty)

user output
(empty)

Test 28

Verdict:

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

correct output
(empty)

user output
(empty)

Test 29

Verdict:

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

correct output
(empty)

user output
(empty)

Test 30

Verdict:

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

correct output
(empty)

user output
(empty)

Test 31

Verdict:

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

correct output
(empty)

user output
(empty)

Test 32

Verdict:

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

correct output
(empty)

user output
(empty)

Test 33

Verdict:

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

correct output
(empty)

user output
(empty)

Test 34

Verdict:

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

correct output
(empty)

user output
(empty)

Test 35

Verdict:

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

correct output
(empty)

user output
(empty)

Test 36

Verdict:

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

correct output
(empty)

user output
(empty)

Test 37

Verdict:

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

correct output
(empty)

user output
(empty)

Test 38

Verdict:

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

correct output
(empty)

user output
(empty)

Test 39

Verdict:

input
2 1
fu
dl 32

correct output
(empty)

user output
(empty)

Test 40

Verdict:

input
3 1
fuuicsxvc
fuuicsxvc 243

correct output
(empty)

user output
(empty)

Test 41

Verdict:

input
4 1
bcytu
bcytu 1024

correct output
(empty)

user output
(empty)