CSES - Aalto Competitive Programming 2024 - wk2 - Wed - Results
Submission details
Task:LibBot
Sender:aalto2024b_007
Submission time:2024-09-11 17:12:56 +0300
Language:C++ (C++17)
Status:READY
Result:
Test results
testverdicttime
#10.02 sdetails
#20.02 sdetails
#30.01 sdetails
#40.02 sdetails
#50.01 sdetails
#60.01 sdetails
#70.02 sdetails
#80.02 sdetails
#90.01 sdetails
#100.02 sdetails
#110.02 sdetails
#120.02 sdetails
#130.02 sdetails
#140.02 sdetails
#150.02 sdetails
#160.02 sdetails
#170.02 sdetails
#180.02 sdetails
#190.02 sdetails
#200.02 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.01 sdetails
#310.02 sdetails
#320.02 sdetails
#330.02 sdetails
#340.02 sdetails
#350.02 sdetails
#360.01 sdetails
#370.02 sdetails
#380.02 sdetails
#390.02 sdetails
#400.02 sdetails
#410.01 sdetails

Code

#include <bits/stdc++.h>
using namespace std;
using ll = long long;

int n, n5;

int f(const string& s, int i) {
	string msg;
	for (int j = 0; j < 5; ++j) {
		msg = to_string(i % n + 1) + msg;
		if (j != 4) msg.insert(msg.begin(), '.');
	}
	cout << "FETCH " << msg << '\n';
	string s2;
	cin >> s2;
	assert(s2 == "FOUND");
	cin >> s2;
	return s.compare(s2);
}

int count(string str) {
	int s = 0;
	for (int i = 1<<17; i >= 1; i /= 2) {
		s += i;
		if (s >= n5) {
			s -= i;
			continue;
		}
		int r = f(str, s);
		if (r >= 0) {
			s -= i;
		}
	}
	int s0 = s;
	s = 0;
	for (int i = 1<<17; i >= 1; i /= 2) {
		s += i;
		if (s >= n5) {
			s -= i;
			continue;
		}
		int r = f(str, s);
		if (r > 0) {
			s -= i;
		}
	}
	return s - s0;
}

int main() {
	while (true) {
		string type;
		cin >> type;
		if (type == "SIZE") {
			cin >> n;
			n5 = n*n*n*n*n;
		}
		if (type == "COUNT") {
			string str;
			cin >> str;
			cout << "GOT " << count(str) << '\n';
			break;
		}
	}
}

Test details

Test 1

Verdict:

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

correct output
(empty)

user output
SIZE 2
COUNT kdg
GOT FETCH 1.1.1.1.1

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
GOT FETCH 3.3.3.3.3

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
GOT FETCH 1.1.1.1.1

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
GOT FETCH 4.4.4.4.4

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
GOT FETCH 5.5.5.5.5

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
GOT FETCH 5.5.5.5.5

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
GOT FETCH 1.1.1.1.1

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
GOT FETCH 9.9.9.9.9

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
GOT FETCH 7.7.7.7.7

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
GOT FETCH 7.7.7.7.7

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
GOT FETCH 9.9.9.9.9

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
GOT FETCH 1.1.1.1.1

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
GOT FETCH 5.5.5.5.5

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
GOT FETCH 5.5.5.5.5

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
GOT FETCH 1.1.1.1.1

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
GOT FETCH 9.9.9.9.9

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
GOT FETCH 1.1.1.1.1

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
GOT FETCH 5.5.5.5.5

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
GOT FETCH 5.5.5.5.5

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
GOT FETCH 1.1.1.1.1

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
GOT FETCH 3.3.3.3.3

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
GOT FETCH 1.1.1.1.1

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
GOT FETCH 4.4.4.4.4

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
GOT FETCH 5.5.5.5.5

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
GOT FETCH 5.5.5.5.5

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
GOT FETCH 1.1.1.1.1

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
GOT FETCH 9.9.9.9.9

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
GOT FETCH 7.7.7.7.7

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
GOT FETCH 7.7.7.7.7

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
GOT FETCH 9.9.9.9.9

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
GOT FETCH 1.1.1.1.1

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
GOT FETCH 5.5.5.5.5

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
GOT FETCH 5.5.5.5.5

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
GOT FETCH 1.1.1.1.1

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
GOT FETCH 9.9.9.9.9

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
GOT FETCH 1.1.1.1.1

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
GOT FETCH 5.5.5.5.5

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
GOT FETCH 5.5.5.5.5

Error:
1 1 0 0

Test 39

Verdict:

input
2 1
fu
dl 32

correct output
(empty)

user output
SIZE 2
COUNT fu
GOT FETCH 1.1.1.1.1

Error:
1 1 0 0

Test 40

Verdict:

input
3 1
fuuicsxvc
fuuicsxvc 243

correct output
(empty)

user output
SIZE 3
COUNT fuuicsxvc
GOT FETCH 3.3.3.3.3

Error:
1 1 0 0

Test 41

Verdict:

input
4 1
bcytu
bcytu 1024

correct output
(empty)

user output
SIZE 4
COUNT bcytu
GOT FETCH 1.1.1.1.1

Error:
1 1 0 0