Task: | LibBot |
Sender: | aalto2024b_007 |
Submission time: | 2024-09-11 17:19:56 +0300 |
Language: | C++ (C++17) |
Status: | READY |
Result: | ACCEPTED |
test | verdict | time | |
---|---|---|---|
#1 | ACCEPTED | 0.01 s | details |
#2 | ACCEPTED | 0.01 s | details |
#3 | ACCEPTED | 0.01 s | details |
#4 | ACCEPTED | 0.01 s | details |
#5 | ACCEPTED | 0.01 s | details |
#6 | ACCEPTED | 0.02 s | details |
#7 | ACCEPTED | 0.01 s | details |
#8 | ACCEPTED | 0.02 s | details |
#9 | ACCEPTED | 0.01 s | details |
#10 | ACCEPTED | 0.01 s | details |
#11 | ACCEPTED | 0.02 s | details |
#12 | ACCEPTED | 0.02 s | details |
#13 | ACCEPTED | 0.01 s | details |
#14 | ACCEPTED | 0.02 s | details |
#15 | ACCEPTED | 0.02 s | details |
#16 | ACCEPTED | 0.01 s | details |
#17 | ACCEPTED | 0.02 s | details |
#18 | ACCEPTED | 0.01 s | details |
#19 | ACCEPTED | 0.01 s | details |
#20 | ACCEPTED | 0.01 s | details |
#21 | ACCEPTED | 0.01 s | details |
#22 | ACCEPTED | 0.02 s | details |
#23 | ACCEPTED | 0.01 s | details |
#24 | ACCEPTED | 0.01 s | details |
#25 | ACCEPTED | 0.02 s | details |
#26 | ACCEPTED | 0.02 s | details |
#27 | ACCEPTED | 0.01 s | details |
#28 | ACCEPTED | 0.02 s | details |
#29 | ACCEPTED | 0.01 s | details |
#30 | ACCEPTED | 0.02 s | details |
#31 | ACCEPTED | 0.02 s | details |
#32 | ACCEPTED | 0.01 s | details |
#33 | ACCEPTED | 0.01 s | details |
#34 | ACCEPTED | 0.01 s | details |
#35 | ACCEPTED | 0.01 s | details |
#36 | ACCEPTED | 0.01 s | details |
#37 | ACCEPTED | 0.02 s | details |
#38 | ACCEPTED | 0.01 s | details |
#39 | ACCEPTED | 0.01 s | details |
#40 | ACCEPTED | 0.01 s | details |
#41 | ACCEPTED | 0.01 s | details |
Code
#include <bits/stdc++.h> using namespace std; using ll = long long; int n, n5; int f(const string& s, int i) { if (i < 0) return -1; if (i >= n5) return 1; string msg; for (int j = 0; j < 5; ++j) { msg = to_string(i % n + 1) + msg; if (j != 4) msg.insert(msg.begin(), '.'); i /= n; } cout << "FETCH " << msg << '\n'; string s_, s2; cin >> s_ >> s2; return s2 < s ? -1 : s2 > s ? 1 : 0; } int count(string str) { int s = -1; for (int i = 1<<17; i >= 1; i /= 2) { s += i; 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; 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; const int c = count(str); cout << "GOT " << c << '\n'; break; } } }
Test details
Test 1
Verdict: ACCEPTED
input |
---|
2 9 kdg dl 6 kdg 3 kdgwl 1 ... |
correct output |
---|
(empty) |
user output |
---|
SIZE 2 COUNT kdg FETCH 2.2.2.2.2 FOUND zdg FETCH 1.2.2.2.2 ... Truncated |
Error:
1 1 1 0
Test 2
Verdict: ACCEPTED
input |
---|
3 15 irwkfl c 26 d 27 e 11 ... |
correct output |
---|
(empty) |
user output |
---|
SIZE 3 COUNT irwkfl FETCH 2.2.3.1.2 FOUND fuuicsxvc FETCH 3.2.1.1.3 ... Truncated |
Error:
1 1 1 0
Test 3
Verdict: ACCEPTED
input |
---|
4 34 gcnmkobrd bcytu 60 bheb 64 bhebp 26 ... |
correct output |
---|
(empty) |
user output |
---|
SIZE 4 COUNT gcnmkobrd FETCH 4.4.4.4.4 FOUND zs FETCH 2.4.4.4.4 ... Truncated |
Error:
1 1 1 0
Test 4
Verdict: ACCEPTED
input |
---|
5 52 faoluuicsn a 1 cufqs 30 d 44 ... |
correct output |
---|
(empty) |
user output |
---|
SIZE 5 COUNT faoluuicsn FETCH 4.2.2.5.3 FOUND uvka FETCH 2.4.1.5.4 ... Truncated |
Error:
1 1 1 0
Test 5
Verdict: ACCEPTED
input |
---|
6 75 okokxlluuicsnw a 1 b 51 bxcufq 145 ... |
correct output |
---|
(empty) |
user output |
---|
SIZE 6 COUNT okokxlluuicsnw FETCH 4.1.6.5.4 FOUND okokxll FETCH 5.5.3.4.6 ... Truncated |
Error:
1 1 1 0
Test 6
Verdict: ACCEPTED
input |
---|
7 105 jibgewnvmqnpbxvirxmgf a 1 aqykhme 32 atusxwa 119 ... |
correct output |
---|
(empty) |
user output |
---|
SIZE 7 COUNT jibgewnvmqnpbxvirxmgf FETCH 7.6.6.3.4 FOUND zeduteacnbnhogwo FETCH 4.3.7.2.2 ... Truncated |
Error:
1 1 1 0
Test 7
Verdict: ACCEPTED
input |
---|
8 124 djnofmgdbfj afpc 66 apj 204 apjgsu 105 ... |
correct output |
---|
(empty) |
user output |
---|
SIZE 8 COUNT djnofmgdbfj FETCH 8.8.8.8.8 FOUND zvxet FETCH 4.8.8.8.8 ... Truncated |
Error:
1 1 1 0
Test 8
Verdict: ACCEPTED
input |
---|
9 166 qonvyqgibutxey a 94 act 683 afngrwb 20 ... |
correct output |
---|
(empty) |
user output |
---|
SIZE 9 COUNT qonvyqgibutxey FETCH 5.9.9.5.8 FOUND pboopgsgcnk FETCH 8.5.4.8.3 ... Truncated |
Error:
1 1 1 0
Test 9
Verdict: ACCEPTED
input |
---|
10 211 zuek axof 303 axofdxjyeevjxifd 397 axofvxnleg 539 ... |
correct output |
---|
(empty) |
user output |
---|
SIZE 10 COUNT zuek FETCH 7.6.6.4.6 FOUND nsvpnqeezmylims FETCH 10.9.4.1.4 ... Truncated |
Error:
1 1 1 0
Test 10
Verdict: ACCEPTED
input |
---|
10 216 hskapswvzfrbijqwgotkothu aayuulyq 436 aayuulyqcs 205 aayuulyqcsgjqffbfix 530 ... |
correct output |
---|
(empty) |
user output |
---|
SIZE 10 COUNT hskapswvzfrbijqwgotkothu FETCH 7.6.6.4.6 FOUND pwcw FETCH 4.3.8.7.8 ... Truncated |
Error:
1 1 1 0
Test 11
Verdict: ACCEPTED
input |
---|
9 158 ylhjecnhgyboje a 691 acd 241 apkcczfzzxrpvlk 88 ... |
correct output |
---|
(empty) |
user output |
---|
SIZE 9 COUNT ylhjecnhgyboje FETCH 5.9.9.5.8 FOUND m FETCH 8.5.4.8.3 ... Truncated |
Error:
1 1 1 0
Test 12
Verdict: ACCEPTED
input |
---|
8 133 ewcm aavhwtselm 486 aavrwtsejm 170 aayuuly 62 ... |
correct output |
---|
(empty) |
user output |
---|
SIZE 8 COUNT ewcm FETCH 8.8.8.8.8 FOUND zsclgdhgnu FETCH 4.8.8.8.8 ... Truncated |
Error:
1 1 1 0
Test 13
Verdict: ACCEPTED
input |
---|
7 98 jkpxbvb awb 326 comccswxez 114 cw 42 ... |
correct output |
---|
(empty) |
user output |
---|
SIZE 7 COUNT jkpxbvb FETCH 7.6.6.3.4 FOUND zyznusp FETCH 4.3.7.2.2 ... Truncated |
Error:
1 1 1 0
Test 14
Verdict: ACCEPTED
input |
---|
6 70 eaymki alkio 119 alkioruv 72 alkioruvyivod 26 ... |
correct output |
---|
(empty) |
user output |
---|
SIZE 6 COUNT eaymki FETCH 4.1.6.5.4 FOUND m FETCH 2.4.3.6.2 ... Truncated |
Error:
1 1 1 0
Test 15
Verdict: ACCEPTED
input |
---|
4 28 unje biybsjet 60 biybsjetnn 27 bx 45 ... |
correct output |
---|
(empty) |
user output |
---|
SIZE 4 COUNT unje FETCH 4.4.4.4.4 FOUND yugojuynkfa FETCH 2.4.4.4.4 ... Truncated |
Error:
1 1 1 0
Test 16
Verdict: ACCEPTED
input |
---|
9 159 ckfhsouqxvv a 373 aahay 152 asvvihxxokcevotlncilqbuvhmdkmh... |
correct output |
---|
(empty) |
user output |
---|
SIZE 9 COUNT ckfhsouqxvv FETCH 5.9.9.5.8 FOUND mhf FETCH 3.5.5.3.4 ... Truncated |
Error:
1 1 1 0
Test 17
Verdict: ACCEPTED
input |
---|
8 117 h aaha 262 anmuhfjbetlfzdbns 107 awhfbhdbjbuexgbwl 226 ... |
correct output |
---|
(empty) |
user output |
---|
SIZE 8 COUNT h FETCH 8.8.8.8.8 FOUND zpksskp FETCH 4.8.8.8.8 ... Truncated |
Error:
1 1 1 0
Test 18
Verdict: ACCEPTED
input |
---|
7 106 m aezpq 42 aokpn 7 aqfkfe 86 ... |
correct output |
---|
(empty) |
user output |
---|
SIZE 7 COUNT m FETCH 7.6.6.3.4 FOUND zf FETCH 4.3.7.2.2 ... Truncated |
Error:
1 1 1 0
Test 19
Verdict: ACCEPTED
input |
---|
7 101 kvtwj appvlr 240 bguzpylrzkwon 78 bofd 2 ... |
correct output |
---|
(empty) |
user output |
---|
SIZE 7 COUNT kvtwj FETCH 7.6.6.3.4 FOUND zdltz FETCH 4.3.7.2.2 ... Truncated |
Error:
1 1 1 0
Test 20
Verdict: ACCEPTED
input |
---|
2 9 fu dl 6 kdg 3 kdgwl 1 ... |
correct output |
---|
(empty) |
user output |
---|
SIZE 2 COUNT fu FETCH 2.2.2.2.2 FOUND zdg FETCH 1.2.2.2.2 ... Truncated |
Error:
1 1 1 0
Test 21
Verdict: ACCEPTED
input |
---|
3 15 uvk c 26 d 27 e 11 ... |
correct output |
---|
(empty) |
user output |
---|
SIZE 3 COUNT uvk FETCH 2.2.3.1.2 FOUND fuuicsxvc FETCH 3.2.1.1.3 ... Truncated |
Error:
1 1 1 0
Test 22
Verdict: ACCEPTED
input |
---|
4 34 jgtx bcytu 60 bheb 64 bhebp 26 ... |
correct output |
---|
(empty) |
user output |
---|
SIZE 4 COUNT jgtx FETCH 4.4.4.4.4 FOUND zs FETCH 2.4.4.4.4 ... Truncated |
Error:
1 1 1 0
Test 23
Verdict: ACCEPTED
input |
---|
5 52 ghmfq a 1 cufqs 30 d 44 ... |
correct output |
---|
(empty) |
user output |
---|
SIZE 5 COUNT ghmfq FETCH 4.2.2.5.3 FOUND uvka FETCH 2.4.1.5.4 ... Truncated |
Error:
1 1 1 0
Test 24
Verdict: ACCEPTED
input |
---|
6 75 ojuphd a 1 b 51 bxcufq 145 ... |
correct output |
---|
(empty) |
user output |
---|
SIZE 6 COUNT ojuphd FETCH 4.1.6.5.4 FOUND okokxll FETCH 2.4.3.6.2 ... Truncated |
Error:
1 1 1 0
Test 25
Verdict: ACCEPTED
input |
---|
7 105 kzzqfzz a 1 aqykhme 32 atusxwa 119 ... |
correct output |
---|
(empty) |
user output |
---|
SIZE 7 COUNT kzzqfzz FETCH 7.6.6.3.4 FOUND zeduteacnbnhogwo FETCH 4.3.7.2.2 ... Truncated |
Error:
1 1 1 0
Test 26
Verdict: ACCEPTED
input |
---|
8 124 emdxvwdw afpc 66 apj 204 apjgsu 105 ... |
correct output |
---|
(empty) |
user output |
---|
SIZE 8 COUNT emdxvwdw FETCH 8.8.8.8.8 FOUND zvxet FETCH 4.8.8.8.8 ... Truncated |
Error:
1 1 1 0
Test 27
Verdict: ACCEPTED
input |
---|
9 166 pkhsbasuj a 94 act 683 afngrwb 20 ... |
correct output |
---|
(empty) |
user output |
---|
SIZE 9 COUNT pkhsbasuj FETCH 5.9.9.5.8 FOUND pboopgsgcnk FETCH 8.5.4.8.3 ... Truncated |
Error:
1 1 1 0
Test 28
Verdict: ACCEPTED
input |
---|
10 211 zypqadmqoo axof 303 axofdxjyeevjxifd 397 axofvxnleg 539 ... |
correct output |
---|
(empty) |
user output |
---|
SIZE 10 COUNT zypqadmqoo FETCH 7.6.6.4.6 FOUND nsvpnqeezmylims FETCH 10.9.4.1.4 ... Truncated |
Error:
1 1 1 0
Test 29
Verdict: ACCEPTED
input |
---|
10 216 jhagispreh aayuulyq 436 aayuulyqcs 205 aayuulyqcsgjqffbfix 530 ... |
correct output |
---|
(empty) |
user output |
---|
SIZE 10 COUNT jhagispreh FETCH 7.6.6.4.6 FOUND pwcw FETCH 4.3.8.7.8 ... Truncated |
Error:
1 1 1 0
Test 30
Verdict: ACCEPTED
input |
---|
9 158 zfkmqpzht a 691 acd 241 apkcczfzzxrpvlk 88 ... |
correct output |
---|
(empty) |
user output |
---|
SIZE 9 COUNT zfkmqpzht FETCH 5.9.9.5.8 FOUND m FETCH 8.5.4.8.3 ... Truncated |
Error:
1 1 1 0
Test 31
Verdict: ACCEPTED
input |
---|
8 133 dogiavnu aavhwtselm 486 aavrwtsejm 170 aayuuly 62 ... |
correct output |
---|
(empty) |
user output |
---|
SIZE 8 COUNT dogiavnu FETCH 8.8.8.8.8 FOUND zsclgdhgnu FETCH 4.8.8.8.8 ... Truncated |
Error:
1 1 1 0
Test 32
Verdict: ACCEPTED
input |
---|
7 98 kihqiff awb 326 comccswxez 114 cw 42 ... |
correct output |
---|
(empty) |
user output |
---|
SIZE 7 COUNT kihqiff FETCH 7.6.6.3.4 FOUND zyznusp FETCH 4.3.7.2.2 ... Truncated |
Error:
1 1 1 0
Test 33
Verdict: ACCEPTED
input |
---|
6 70 eszubi alkio 119 alkioruv 72 alkioruvyivod 26 ... |
correct output |
---|
(empty) |
user output |
---|
SIZE 6 COUNT eszubi FETCH 4.1.6.5.4 FOUND m FETCH 2.4.3.6.2 ... Truncated |
Error:
1 1 1 0
Test 34
Verdict: ACCEPTED
input |
---|
4 28 vyta biybsjet 60 biybsjetnn 27 bx 45 ... |
correct output |
---|
(empty) |
user output |
---|
SIZE 4 COUNT vyta FETCH 4.4.4.4.4 FOUND yugojuynkfa FETCH 2.4.4.4.4 ... Truncated |
Error:
1 1 1 0
Test 35
Verdict: ACCEPTED
input |
---|
9 159 ctohjykey a 373 aahay 152 asvvihxxokcevotlncilqbuvhmdkmh... |
correct output |
---|
(empty) |
user output |
---|
SIZE 9 COUNT ctohjykey FETCH 5.9.9.5.8 FOUND mhf FETCH 3.5.5.3.4 ... Truncated |
Error:
1 1 1 0
Test 36
Verdict: ACCEPTED
input |
---|
8 117 igjxpndn aaha 262 anmuhfjbetlfzdbns 107 awhfbhdbjbuexgbwl 226 ... |
correct output |
---|
(empty) |
user output |
---|
SIZE 8 COUNT igjxpndn FETCH 8.8.8.8.8 FOUND zpksskp FETCH 4.8.8.8.8 ... Truncated |
Error:
1 1 1 0
Test 37
Verdict: ACCEPTED
input |
---|
7 106 lslhnht aezpq 42 aokpn 7 aqfkfe 86 ... |
correct output |
---|
(empty) |
user output |
---|
SIZE 7 COUNT lslhnht FETCH 7.6.6.3.4 FOUND zf FETCH 4.3.7.2.2 ... Truncated |
Error:
1 1 1 0
Test 38
Verdict: ACCEPTED
input |
---|
7 101 hxliesh appvlr 240 bguzpylrzkwon 78 bofd 2 ... |
correct output |
---|
(empty) |
user output |
---|
SIZE 7 COUNT hxliesh FETCH 7.6.6.3.4 FOUND zdltz FETCH 4.3.7.2.2 ... Truncated |
Error:
1 1 1 0
Test 39
Verdict: ACCEPTED
input |
---|
2 1 fu dl 32 |
correct output |
---|
(empty) |
user output |
---|
SIZE 2 COUNT fu FETCH 2.2.2.2.2 FOUND dl FETCH 2.1.1.1.1 ... Truncated |
Error:
1 1 1 0
Test 40
Verdict: ACCEPTED
input |
---|
3 1 fuuicsxvc fuuicsxvc 243 |
correct output |
---|
(empty) |
user output |
---|
SIZE 3 COUNT fuuicsxvc FETCH 2.2.3.1.2 FOUND fuuicsxvc FETCH 1.3.2.1.1 ... Truncated |
Error:
1 1 1 0
Test 41
Verdict: ACCEPTED
input |
---|
4 1 bcytu bcytu 1024 |
correct output |
---|
(empty) |
user output |
---|
SIZE 4 COUNT bcytu FETCH 4.4.4.4.4 FOUND bcytu FETCH 2.4.4.4.4 ... Truncated |
Error:
1 1 1 0