CSES - Aalto Competitive Programming 2024 - wk2 - Wed - Results
Submission details
Task:LibBot
Sender:aalto2024b_003
Submission time:2024-09-11 16:42:03 +0300
Language:C++ (C++20)
Status:READY
Result:
Test results
testverdicttime
#10.02 sdetails
#20.02 sdetails
#30.02 sdetails
#40.02 sdetails
#50.01 sdetails
#60.02 sdetails
#70.01 sdetails
#80.02 sdetails
#90.02 sdetails
#100.02 sdetails
#110.02 sdetails
#120.02 sdetails
#130.01 sdetails
#140.01 sdetails
#150.02 sdetails
#160.02 sdetails
#170.01 sdetails
#180.01 sdetails
#190.01 sdetails
#200.01 sdetails
#210.02 sdetails
#220.02 sdetails
#230.02 sdetails
#240.02 sdetails
#250.02 sdetails
#260.02 sdetails
#270.02 sdetails
#280.02 sdetails
#290.02 sdetails
#300.02 sdetails
#310.02 sdetails
#320.02 sdetails
#330.02 sdetails
#340.02 sdetails
#350.01 sdetails
#360.02 sdetails
#370.02 sdetails
#380.02 sdetails
#390.02 sdetails
#400.02 sdetails
#410.02 sdetails

Code

#include <bits/stdc++.h>
using namespace std;
#define int long long

string to_string(string s) {
    return '"' + s + '"';
}
 
string to_string(const char* s) {
    return to_string((string) s);
}
 
string to_string(bool b) {
    return (b ? "true" : "false");
}
 
template <typename A, typename B>
string to_string(pair<A, B> p) {
    return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
 
template <typename A>
string to_string(A v) {
    bool first = true;
    string res = "{";
    for (const auto &x : v) {
        if (!first) {
            res += ", ";
        }
        first = false;
        res += to_string(x);
    }
    res += "}";
    return res;
}
 
void debug_out() {
    cerr << endl;
}
 
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
    cerr << " " << to_string(H);
    debug_out(T...);
}
 
#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif

const int N = 2e5 + 5;

signed main() {
    cin.tie(0)->sync_with_stdio(0);

    string tmp;
    
    cin >> tmp;
    int n;
    cin >> n;

    cin >> tmp;
    string need;
    cin >> need;

    int mx = n * n * n * n * n;

    auto fetch = [&](int val) {
        cout << "FETCH ";
        cout << ((val / (n * n * n * n)) % n + 1) << ".";
        cout << ((val / (n * n * n)) % n + 1) << ".";
        cout << ((val / (n * n)) % n + 1) << ".";
        cout << ((val / (n)) % n + 1) << ".";
        cout << (val % (n) + 1) << endl;
    };

    cout << mx - 1 << '\n';
    fetch(mx - 1);

    auto check1 = [&](int mid) {
        fetch(mid);
        string got;
        cin >> got;
        return got >= need;
    };

    int lo = 0, hi = mx - 1;
    int ans = 0;
    while (lo <= hi) {
        int mid = lo + (hi - lo) / 2;
        if (check1(mid)) {
            ans = mid;
            hi = mid - 1;
        } else {
            lo = mid + 1;
        }
    }

    auto check2 = [&](int mid) {
        fetch(mid);
        string got;
        cin >> got;
        return got == need;
    };

    lo = ans, hi = mx - 1;
    int ans2 = ans;
    while (lo <= hi) {
        int mid = lo + (hi - lo) / 2;
        if (check2(mid)) {
            ans2 = mid;
            lo = mid + 1;
        } else {
            hi = mid - 1;
        }
    }

    cout << "GOT " << ans2 - ans + 1 << endl;
}

Test details

Test 1

Verdict:

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

correct output
(empty)

user output
SIZE 2
COUNT kdg
31
FETCH 2.2.2.2.2
FETCH 1.2.2.2.2

Error:
1 1 0 0

Test 2

Verdict:

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

correct output
(empty)

user output
SIZE 3
COUNT irwkfl
242
FETCH 3.3.3.3.3
FETCH 2.2.2.2.2

Error:
1 1 0 0

Test 3

Verdict:

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

correct output
(empty)

user output
SIZE 4
COUNT gcnmkobrd
1023
FETCH 4.4.4.4.4
FETCH 2.4.4.4.4

Error:
1 1 0 0

Test 4

Verdict:

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

correct output
(empty)

user output
SIZE 5
COUNT faoluuicsn
3124
FETCH 5.5.5.5.5
FETCH 3.3.3.3.3

Error:
1 1 0 0

Test 5

Verdict:

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

correct output
(empty)

user output
SIZE 6
COUNT okokxlluuicsnw
7775
FETCH 6.6.6.6.6
FETCH 3.6.6.6.6

Error:
1 1 0 0

Test 6

Verdict:

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

correct output
(empty)

user output
SIZE 7
COUNT jibgewnvmqnpbxvirxmgf
16806
FETCH 7.7.7.7.7
FETCH 4.4.4.4.4

Error:
1 1 0 0

Test 7

Verdict:

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

correct output
(empty)

user output
SIZE 8
COUNT djnofmgdbfj
32767
FETCH 8.8.8.8.8
FETCH 4.8.8.8.8

Error:
1 1 0 0

Test 8

Verdict:

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

correct output
(empty)

user output
SIZE 9
COUNT qonvyqgibutxey
59048
FETCH 9.9.9.9.9
FETCH 5.5.5.5.5

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
COUNT zuek
99999
FETCH 10.10.10.10.10
FETCH 5.10.10.10.10

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
COUNT hskapswvzfrbijqwgotkothu
99999
FETCH 10.10.10.10.10
FETCH 5.10.10.10.10

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
COUNT ylhjecnhgyboje
59048
FETCH 9.9.9.9.9
FETCH 5.5.5.5.5

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
COUNT ewcm
32767
FETCH 8.8.8.8.8
FETCH 4.8.8.8.8

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
COUNT jkpxbvb
16806
FETCH 7.7.7.7.7
FETCH 4.4.4.4.4

Error:
1 1 0 0

Test 14

Verdict:

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

correct output
(empty)

user output
SIZE 6
COUNT eaymki
7775
FETCH 6.6.6.6.6
FETCH 3.6.6.6.6

Error:
1 1 0 0

Test 15

Verdict:

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

correct output
(empty)

user output
SIZE 4
COUNT unje
1023
FETCH 4.4.4.4.4
FETCH 2.4.4.4.4

Error:
1 1 0 0

Test 16

Verdict:

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

correct output
(empty)

user output
SIZE 9
COUNT ckfhsouqxvv
59048
FETCH 9.9.9.9.9
FETCH 5.5.5.5.5

Error:
1 1 0 0

Test 17

Verdict:

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

correct output
(empty)

user output
SIZE 8
COUNT h
32767
FETCH 8.8.8.8.8
FETCH 4.8.8.8.8

Error:
1 1 0 0

Test 18

Verdict:

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

correct output
(empty)

user output
SIZE 7
COUNT m
16806
FETCH 7.7.7.7.7
FETCH 4.4.4.4.4

Error:
1 1 0 0

Test 19

Verdict:

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

correct output
(empty)

user output
SIZE 7
COUNT kvtwj
16806
FETCH 7.7.7.7.7
FETCH 4.4.4.4.4

Error:
1 1 0 0

Test 20

Verdict:

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

correct output
(empty)

user output
SIZE 2
COUNT fu
31
FETCH 2.2.2.2.2
FETCH 1.2.2.2.2

Error:
1 1 0 0

Test 21

Verdict:

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

correct output
(empty)

user output
SIZE 3
COUNT uvk
242
FETCH 3.3.3.3.3
FETCH 2.2.2.2.2

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
COUNT jgtx
1023
FETCH 4.4.4.4.4
FETCH 2.4.4.4.4

Error:
1 1 0 0

Test 23

Verdict:

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

correct output
(empty)

user output
SIZE 5
COUNT ghmfq
3124
FETCH 5.5.5.5.5
FETCH 3.3.3.3.3

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
COUNT ojuphd
7775
FETCH 6.6.6.6.6
FETCH 3.6.6.6.6

Error:
1 1 0 0

Test 25

Verdict:

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

correct output
(empty)

user output
SIZE 7
COUNT kzzqfzz
16806
FETCH 7.7.7.7.7
FETCH 4.4.4.4.4

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
COUNT emdxvwdw
32767
FETCH 8.8.8.8.8
FETCH 4.8.8.8.8

Error:
1 1 0 0

Test 27

Verdict:

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

correct output
(empty)

user output
SIZE 9
COUNT pkhsbasuj
59048
FETCH 9.9.9.9.9
FETCH 5.5.5.5.5

Error:
1 1 0 0

Test 28

Verdict:

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

correct output
(empty)

user output
SIZE 10
COUNT zypqadmqoo
99999
FETCH 10.10.10.10.10
FETCH 5.10.10.10.10

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
COUNT jhagispreh
99999
FETCH 10.10.10.10.10
FETCH 5.10.10.10.10

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
COUNT zfkmqpzht
59048
FETCH 9.9.9.9.9
FETCH 5.5.5.5.5

Error:
1 1 0 0

Test 31

Verdict:

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

correct output
(empty)

user output
SIZE 8
COUNT dogiavnu
32767
FETCH 8.8.8.8.8
FETCH 4.8.8.8.8

Error:
1 1 0 0

Test 32

Verdict:

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

correct output
(empty)

user output
SIZE 7
COUNT kihqiff
16806
FETCH 7.7.7.7.7
FETCH 4.4.4.4.4

Error:
1 1 0 0

Test 33

Verdict:

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

correct output
(empty)

user output
SIZE 6
COUNT eszubi
7775
FETCH 6.6.6.6.6
FETCH 3.6.6.6.6

Error:
1 1 0 0

Test 34

Verdict:

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

correct output
(empty)

user output
SIZE 4
COUNT vyta
1023
FETCH 4.4.4.4.4
FETCH 2.4.4.4.4

Error:
1 1 0 0

Test 35

Verdict:

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

correct output
(empty)

user output
SIZE 9
COUNT ctohjykey
59048
FETCH 9.9.9.9.9
FETCH 5.5.5.5.5

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
COUNT igjxpndn
32767
FETCH 8.8.8.8.8
FETCH 4.8.8.8.8

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
COUNT lslhnht
16806
FETCH 7.7.7.7.7
FETCH 4.4.4.4.4

Error:
1 1 0 0

Test 38

Verdict:

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

correct output
(empty)

user output
SIZE 7
COUNT hxliesh
16806
FETCH 7.7.7.7.7
FETCH 4.4.4.4.4

Error:
1 1 0 0

Test 39

Verdict:

input
2 1
fu
dl 32

correct output
(empty)

user output
SIZE 2
COUNT fu
31
FETCH 2.2.2.2.2
FETCH 1.2.2.2.2

Error:
1 1 0 0

Test 40

Verdict:

input
3 1
fuuicsxvc
fuuicsxvc 243

correct output
(empty)

user output
SIZE 3
COUNT fuuicsxvc
242
FETCH 3.3.3.3.3
FETCH 2.2.2.2.2

Error:
1 1 0 0

Test 41

Verdict:

input
4 1
bcytu
bcytu 1024

correct output
(empty)

user output
SIZE 4
COUNT bcytu
1023
FETCH 4.4.4.4.4
FETCH 2.4.4.4.4

Error:
1 1 0 0