Submission details
Task:LibBot
Sender:aalto25b_002
Submission time:2025-09-10 17:40:21 +0300
Language:C++ (C++17)
Status:READY
Result:
Test results
testverdicttime
#10.03 sdetails
#20.04 sdetails
#30.03 sdetails
#40.03 sdetails
#50.04 sdetails
#60.04 sdetails
#70.03 sdetails
#80.02 sdetails
#90.02 sdetails
#100.02 sdetails
#110.02 sdetails
#120.02 sdetails
#130.03 sdetails
#140.03 sdetails
#150.01 sdetails
#160.03 sdetails
#170.03 sdetails
#180.03 sdetails
#190.04 sdetails
#200.03 sdetails
#210.02 sdetails
#220.03 sdetails
#230.02 sdetails
#240.03 sdetails
#250.01 sdetails
#260.03 sdetails
#270.03 sdetails
#280.02 sdetails
#290.02 sdetails
#300.02 sdetails
#310.03 sdetails
#320.03 sdetails
#330.03 sdetails
#340.02 sdetails
#350.02 sdetails
#360.02 sdetails
#370.03 sdetails
#380.02 sdetails
#390.03 sdetails
#400.02 sdetails
#410.02 sdetails

Compiler report

input/code.cpp: In function 'int main()':
input/code.cpp:45:9: warning: this 'else' clause does not guard... [-Wmisleading-indentation]
   45 |         else
      |         ^~~~
input/code.cpp:47:13: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'else'
   47 |             start = high;
      |             ^~~~~
input/code.cpp:72:16: warning: 'end' may be used uninitialized [-Wmaybe-uninitialized]
   72 |     size = end - start;
      |            ~~~~^~~~~~~

Code

#include <iostream>
#include <algorithm>
#include <queue>
using namespace std;

void print(int num){
    string numS = to_string(num);
    string newNumS = "";
    cout << "FETCH ";
    for(size_t i = 0; i < numS.length(); i++){
        cout << numS[i]; 
        cout << ".";
    }
    cout << endl;
}



int main() {
    int n;
    cin >> n;

    string a,b, name;
    int size;
    int start, end;

    cin >> a >> size;
    cin >> b >> name;

    int low = 0;
    int high = 100000;
    while (low <= high) {
        int mid = low + (high - low) / 2;

        // Check if x is present at mid
        print(mid);
        string x,y;
        cin >> y >> x;

        // If x greater, ignore left half
        if (x < name)
            low = mid + 1;

        // If x is smaller, ignore right half
        else
            high = mid;
            start = high;
    }



    while (low <= high) {
        int mid = low + (high - low) / 2;

        // Check if x is present at mid
        print(mid);
        string x,y;
        cin >> y >> x;
        

        // If x greater, ignore left half
        if (x < name){
            low = mid;
            end = low;
        }

        // If x is smaller, ignore right half
        else
            high = mid - 1;
    }

    size = end - start;
    cout << size << endl;


}


Test details

Test 1

Verdict:

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

correct output
(empty)

user output
SIZE 2
FETCH 5.0.0.0.0.
FETCH 2.5.0.0.0.
FETCH 1.2.5.0.0.
FETCH 6.2.5.0.
...
Truncated

Test 2

Verdict:

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

correct output
(empty)

user output
SIZE 3
FETCH 5.0.0.0.0.
FETCH 2.5.0.0.0.
FETCH 1.2.5.0.0.
FETCH 6.2.5.0.
...
Truncated

Test 3

Verdict:

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

correct output
(empty)

user output
SIZE 4
FETCH 5.0.0.0.0.
FETCH 2.5.0.0.0.
FETCH 1.2.5.0.0.
FETCH 6.2.5.0.
...
Truncated

Test 4

Verdict:

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

correct output
(empty)

user output
SIZE 5
FETCH 5.0.0.0.0.
FETCH 2.5.0.0.0.
FETCH 1.2.5.0.0.
FETCH 6.2.5.0.
...
Truncated

Test 5

Verdict:

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

correct output
(empty)

user output
SIZE 6
FETCH 5.0.0.0.0.
FETCH 2.5.0.0.0.
FETCH 1.2.5.0.0.
FETCH 6.2.5.0.
...
Truncated

Test 6

Verdict:

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

correct output
(empty)

user output
SIZE 7
FETCH 5.0.0.0.0.
FETCH 2.5.0.0.0.
FETCH 1.2.5.0.0.
FETCH 6.2.5.0.
...
Truncated

Test 7

Verdict:

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

correct output
(empty)

user output
SIZE 8
FETCH 5.0.0.0.0.
FETCH 2.5.0.0.0.
FETCH 1.2.5.0.0.
FETCH 6.2.5.0.
...
Truncated

Test 8

Verdict:

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

correct output
(empty)

user output
SIZE 9
FETCH 5.0.0.0.0.
FETCH 2.5.0.0.0.
FETCH 1.2.5.0.0.
FETCH 6.2.5.0.
...
Truncated

Error:
1 1 0 0

Test 9

Verdict:

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

correct output
(empty)

user output
SIZE 10
FETCH 5.0.0.0.0.
FETCH 2.5.0.0.0.
FETCH 1.2.5.0.0.
FETCH 6.2.5.0.
...
Truncated

Error:
1 1 0 0

Test 10

Verdict:

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

correct output
(empty)

user output
SIZE 10
FETCH 5.0.0.0.0.
FETCH 2.5.0.0.0.
FETCH 1.2.5.0.0.
FETCH 6.2.5.0.
...
Truncated

Error:
1 1 0 0

Test 11

Verdict:

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

correct output
(empty)

user output
SIZE 9
FETCH 5.0.0.0.0.
FETCH 2.5.0.0.0.
FETCH 1.2.5.0.0.
FETCH 6.2.5.0.
...
Truncated

Error:
1 1 0 0

Test 12

Verdict:

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

correct output
(empty)

user output
SIZE 8
FETCH 5.0.0.0.0.
FETCH 2.5.0.0.0.
FETCH 1.2.5.0.0.
FETCH 6.2.5.0.
...
Truncated

Error:
1 1 0 0

Test 13

Verdict:

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

correct output
(empty)

user output
SIZE 7
FETCH 5.0.0.0.0.
FETCH 2.5.0.0.0.
FETCH 1.2.5.0.0.
FETCH 6.2.5.0.
...
Truncated

Test 14

Verdict:

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

correct output
(empty)

user output
SIZE 6
FETCH 5.0.0.0.0.
FETCH 2.5.0.0.0.
FETCH 1.2.5.0.0.
FETCH 6.2.5.0.
...
Truncated

Test 15

Verdict:

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

correct output
(empty)

user output
SIZE 4
FETCH 5.0.0.0.0.
FETCH 2.5.0.0.0.
FETCH 1.2.5.0.0.
FETCH 6.2.5.0.
...
Truncated

Error:
1 1 0 0

Test 16

Verdict:

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

correct output
(empty)

user output
SIZE 9
FETCH 5.0.0.0.0.
FETCH 2.5.0.0.0.
FETCH 1.2.5.0.0.
FETCH 6.2.5.0.
...
Truncated

Test 17

Verdict:

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

correct output
(empty)

user output
SIZE 8
FETCH 5.0.0.0.0.
FETCH 2.5.0.0.0.
FETCH 1.2.5.0.0.
FETCH 6.2.5.0.
...
Truncated

Test 18

Verdict:

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

correct output
(empty)

user output
SIZE 7
FETCH 5.0.0.0.0.
FETCH 2.5.0.0.0.
FETCH 1.2.5.0.0.
FETCH 6.2.5.0.
...
Truncated

Test 19

Verdict:

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

correct output
(empty)

user output
SIZE 7
FETCH 5.0.0.0.0.
FETCH 2.5.0.0.0.
FETCH 1.2.5.0.0.
FETCH 6.2.5.0.
...
Truncated

Test 20

Verdict:

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

correct output
(empty)

user output
SIZE 2
FETCH 5.0.0.0.0.
FETCH 2.5.0.0.0.
FETCH 1.2.5.0.0.
FETCH 6.2.5.0.
...
Truncated

Test 21

Verdict:

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

correct output
(empty)

user output
SIZE 3
FETCH 5.0.0.0.0.
FETCH 2.5.0.0.0.
FETCH 1.2.5.0.0.
FETCH 6.2.5.0.
...
Truncated

Error:
1 1 0 0

Test 22

Verdict:

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

correct output
(empty)

user output
SIZE 4
FETCH 5.0.0.0.0.
FETCH 2.5.0.0.0.
FETCH 1.2.5.0.0.
FETCH 6.2.5.0.
...
Truncated

Test 23

Verdict:

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

correct output
(empty)

user output
SIZE 5
FETCH 5.0.0.0.0.
FETCH 2.5.0.0.0.
FETCH 1.2.5.0.0.
FETCH 6.2.5.0.
...
Truncated

Error:
1 1 0 0

Test 24

Verdict:

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

correct output
(empty)

user output
SIZE 6
FETCH 5.0.0.0.0.
FETCH 2.5.0.0.0.
FETCH 1.2.5.0.0.
FETCH 6.2.5.0.
...
Truncated

Test 25

Verdict:

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

correct output
(empty)

user output
SIZE 7
FETCH 5.0.0.0.0.
FETCH 2.5.0.0.0.
FETCH 1.2.5.0.0.
FETCH 6.2.5.0.
...
Truncated

Error:
1 1 0 0

Test 26

Verdict:

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

correct output
(empty)

user output
SIZE 8
FETCH 5.0.0.0.0.
FETCH 2.5.0.0.0.
FETCH 1.2.5.0.0.
FETCH 6.2.5.0.
...
Truncated

Test 27

Verdict:

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

correct output
(empty)

user output
SIZE 9
FETCH 5.0.0.0.0.
FETCH 2.5.0.0.0.
FETCH 1.2.5.0.0.
FETCH 6.2.5.0.
...
Truncated

Test 28

Verdict:

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

correct output
(empty)

user output
SIZE 10
FETCH 5.0.0.0.0.
FETCH 2.5.0.0.0.
FETCH 1.2.5.0.0.
FETCH 6.2.5.0.
...
Truncated

Error:
1 1 0 0

Test 29

Verdict:

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

correct output
(empty)

user output
SIZE 10
FETCH 5.0.0.0.0.
FETCH 2.5.0.0.0.
FETCH 1.2.5.0.0.
FETCH 6.2.5.0.
...
Truncated

Error:
1 1 0 0

Test 30

Verdict:

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

correct output
(empty)

user output
SIZE 9
FETCH 5.0.0.0.0.
FETCH 2.5.0.0.0.
FETCH 1.2.5.0.0.
FETCH 6.2.5.0.
...
Truncated

Test 31

Verdict:

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

correct output
(empty)

user output
SIZE 8
FETCH 5.0.0.0.0.
FETCH 2.5.0.0.0.
FETCH 1.2.5.0.0.
FETCH 6.2.5.0.
...
Truncated

Test 32

Verdict:

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

correct output
(empty)

user output
SIZE 7
FETCH 5.0.0.0.0.
FETCH 2.5.0.0.0.
FETCH 1.2.5.0.0.
FETCH 6.2.5.0.
...
Truncated

Test 33

Verdict:

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

correct output
(empty)

user output
SIZE 6
FETCH 5.0.0.0.0.
FETCH 2.5.0.0.0.
FETCH 1.2.5.0.0.
FETCH 6.2.5.0.
...
Truncated

Test 34

Verdict:

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

correct output
(empty)

user output
SIZE 4
FETCH 5.0.0.0.0.
FETCH 2.5.0.0.0.
FETCH 1.2.5.0.0.
FETCH 6.2.5.0.
...
Truncated

Error:
1 1 0 0

Test 35

Verdict:

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

correct output
(empty)

user output
SIZE 9
FETCH 5.0.0.0.0.
FETCH 2.5.0.0.0.
FETCH 1.2.5.0.0.
FETCH 6.2.5.0.
...
Truncated

Error:
1 1 0 0

Test 36

Verdict:

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

correct output
(empty)

user output
SIZE 8
FETCH 5.0.0.0.0.
FETCH 2.5.0.0.0.
FETCH 1.2.5.0.0.
FETCH 6.2.5.0.
...
Truncated

Error:
1 1 0 0

Test 37

Verdict:

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

correct output
(empty)

user output
SIZE 7
FETCH 5.0.0.0.0.
FETCH 2.5.0.0.0.
FETCH 1.2.5.0.0.
FETCH 6.2.5.0.
...
Truncated

Test 38

Verdict:

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

correct output
(empty)

user output
SIZE 7
FETCH 5.0.0.0.0.
FETCH 2.5.0.0.0.
FETCH 1.2.5.0.0.
FETCH 6.2.5.0.
...
Truncated

Error:
1 1 0 0

Test 39

Verdict:

input
2 1
fu
dl 32

correct output
(empty)

user output
SIZE 2
FETCH 5.0.0.0.0.
FETCH 2.5.0.0.0.
FETCH 1.2.5.0.0.
FETCH 6.2.5.0.
...
Truncated

Test 40

Verdict:

input
3 1
fuuicsxvc
fuuicsxvc 243

correct output
(empty)

user output
SIZE 3
FETCH 5.0.0.0.0.
FETCH 2.5.0.0.0.
FETCH 1.2.5.0.0.
FETCH 6.2.5.0.
...
Truncated

Error:
1 1 0 0

Test 41

Verdict:

input
4 1
bcytu
bcytu 1024

correct output
(empty)

user output
SIZE 4
FETCH 5.0.0.0.0.
FETCH 2.5.0.0.0.
FETCH 1.2.5.0.0.
FETCH 6.2.5.0.
...
Truncated

Error:
1 1 0 0