#include "Anna.h"
#include <bits/stdc++.h>
using namespace std;
pair<string, int> anna(int n, string s) {
string t(131, '.');
if (s[0] == 'R') {
if (s[1] == 'R') t[0] = t[1] = 'G';
else if (s[1] == 'G') t[0] = t[1] = 'B';
else t[0] = t[1] = 'G';
}
else if (s[0] == 'G') {
if (s[1] == 'R') t[0] = t[1] = 'B';
else if (s[1] == 'G') t[0] = t[1] = 'R';
else t[0] = t[1] = 'R';
}
else {
if (s[1] == 'R') t[0] = t[1] = 'G';
else if (s[1] == 'G') t[0] = t[1] = 'R';
else t[0] = t[1] = 'R';
}
if (t[1] == 'R') {
if (s[2] == 'R') t[2] = 'G';
else if (s[2] == 'G') t[2] = 'B';
else t[2] = 'G';
}
else if (t[1] == 'G') {
if (s[2] == 'R') t[2] = 'B';
else if (s[2] == 'G') t[2] = 'R';
else t[2] = 'R';
}
else {
if (s[2] == 'R') t[2] = 'G';
else if (s[2] == 'G') t[2] = 'R';
else t[2] = 'R';
}
for (int i = 3; i < n; i++) {
t[i] = (s[i] == 'R' ? 'G' : 'R');
}
string tt(n, '.');
for (int i = 0; i < n; i++) {
tt[i] = t[i];
}
return make_pair(tt, min(130, n));
}
#include "Bruno.h"
#include <bits/stdc++.h>
using namespace std;
int n, l;
void init(int N, int L) {
n = N;
l = L;
}
int bruno(string u) {
if (n == 1) return 1;
if (u[0] == u[1]) return 1;
else return 2;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
23 ms |
1352 KB |
Output is correct |
2 |
Correct |
23 ms |
1352 KB |
Output is correct |
3 |
Correct |
48 ms |
1312 KB |
Output is correct |
4 |
Correct |
25 ms |
1288 KB |
Output is correct |
5 |
Correct |
26 ms |
1340 KB |
Output is correct |
6 |
Correct |
28 ms |
1328 KB |
Output is correct |
7 |
Correct |
28 ms |
1312 KB |
Output is correct |
8 |
Correct |
29 ms |
1292 KB |
Output is correct |
9 |
Correct |
24 ms |
1344 KB |
Output is correct |
10 |
Correct |
24 ms |
1340 KB |
Output is correct |
11 |
Correct |
39 ms |
1324 KB |
Output is correct |
12 |
Correct |
41 ms |
1312 KB |
Output is correct |
13 |
Correct |
25 ms |
1392 KB |
Output is correct |
14 |
Correct |
26 ms |
1356 KB |
Output is correct |
15 |
Correct |
40 ms |
1356 KB |
Output is correct |
16 |
Correct |
26 ms |
1312 KB |
Output is correct |
17 |
Correct |
41 ms |
1288 KB |
Output is correct |
18 |
Correct |
43 ms |
1352 KB |
Output is correct |
19 |
Correct |
25 ms |
1364 KB |
Output is correct |
20 |
Correct |
25 ms |
1292 KB |
Output is correct |
21 |
Correct |
25 ms |
1340 KB |
Output is correct |
22 |
Correct |
51 ms |
1204 KB |
Output is correct |
23 |
Correct |
25 ms |
1204 KB |
Output is correct |
24 |
Correct |
49 ms |
1316 KB |
Output is correct |
25 |
Correct |
25 ms |
1340 KB |
Output is correct |
26 |
Correct |
27 ms |
1312 KB |
Output is correct |
27 |
Correct |
28 ms |
1376 KB |
Output is correct |
28 |
Correct |
42 ms |
1556 KB |
Output is correct |
29 |
Correct |
43 ms |
1288 KB |
Output is correct |
30 |
Correct |
28 ms |
1376 KB |
Output is correct |
31 |
Correct |
29 ms |
1576 KB |
Output is correct |
32 |
Correct |
29 ms |
1348 KB |
Output is correct |
33 |
Correct |
29 ms |
1384 KB |
Output is correct |
34 |
Correct |
23 ms |
1320 KB |
Output is correct |
35 |
Correct |
30 ms |
1312 KB |
Output is correct |
36 |
Correct |
42 ms |
1308 KB |
Output is correct |
37 |
Correct |
46 ms |
1316 KB |
Output is correct |
38 |
Correct |
54 ms |
1312 KB |
Output is correct |
39 |
Correct |
54 ms |
1336 KB |
Output is correct |
40 |
Correct |
29 ms |
1376 KB |
Output is correct |
41 |
Correct |
28 ms |
1288 KB |
Output is correct |
42 |
Correct |
26 ms |
1308 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
23 ms |
1352 KB |
Output is correct |
2 |
Correct |
23 ms |
1352 KB |
Output is correct |
3 |
Correct |
48 ms |
1312 KB |
Output is correct |
4 |
Correct |
25 ms |
1288 KB |
Output is correct |
5 |
Correct |
26 ms |
1340 KB |
Output is correct |
6 |
Correct |
28 ms |
1328 KB |
Output is correct |
7 |
Correct |
28 ms |
1312 KB |
Output is correct |
8 |
Correct |
29 ms |
1292 KB |
Output is correct |
9 |
Correct |
24 ms |
1344 KB |
Output is correct |
10 |
Correct |
24 ms |
1340 KB |
Output is correct |
11 |
Correct |
39 ms |
1324 KB |
Output is correct |
12 |
Correct |
41 ms |
1312 KB |
Output is correct |
13 |
Correct |
25 ms |
1392 KB |
Output is correct |
14 |
Correct |
26 ms |
1356 KB |
Output is correct |
15 |
Correct |
40 ms |
1356 KB |
Output is correct |
16 |
Correct |
26 ms |
1312 KB |
Output is correct |
17 |
Correct |
41 ms |
1288 KB |
Output is correct |
18 |
Correct |
43 ms |
1352 KB |
Output is correct |
19 |
Correct |
25 ms |
1364 KB |
Output is correct |
20 |
Correct |
25 ms |
1292 KB |
Output is correct |
21 |
Correct |
25 ms |
1340 KB |
Output is correct |
22 |
Correct |
51 ms |
1204 KB |
Output is correct |
23 |
Correct |
25 ms |
1204 KB |
Output is correct |
24 |
Correct |
49 ms |
1316 KB |
Output is correct |
25 |
Correct |
25 ms |
1340 KB |
Output is correct |
26 |
Correct |
27 ms |
1312 KB |
Output is correct |
27 |
Correct |
28 ms |
1376 KB |
Output is correct |
28 |
Correct |
42 ms |
1556 KB |
Output is correct |
29 |
Correct |
43 ms |
1288 KB |
Output is correct |
30 |
Correct |
28 ms |
1376 KB |
Output is correct |
31 |
Correct |
29 ms |
1576 KB |
Output is correct |
32 |
Correct |
29 ms |
1348 KB |
Output is correct |
33 |
Correct |
29 ms |
1384 KB |
Output is correct |
34 |
Correct |
23 ms |
1320 KB |
Output is correct |
35 |
Correct |
30 ms |
1312 KB |
Output is correct |
36 |
Correct |
42 ms |
1308 KB |
Output is correct |
37 |
Correct |
46 ms |
1316 KB |
Output is correct |
38 |
Correct |
54 ms |
1312 KB |
Output is correct |
39 |
Correct |
54 ms |
1336 KB |
Output is correct |
40 |
Correct |
29 ms |
1376 KB |
Output is correct |
41 |
Correct |
28 ms |
1288 KB |
Output is correct |
42 |
Correct |
26 ms |
1308 KB |
Output is correct |
43 |
Runtime error |
1 ms |
1368 KB |
Execution killed with signal 6 |
44 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
23 ms |
1352 KB |
Output is correct |
2 |
Correct |
23 ms |
1352 KB |
Output is correct |
3 |
Correct |
48 ms |
1312 KB |
Output is correct |
4 |
Correct |
25 ms |
1288 KB |
Output is correct |
5 |
Correct |
26 ms |
1340 KB |
Output is correct |
6 |
Correct |
28 ms |
1328 KB |
Output is correct |
7 |
Correct |
28 ms |
1312 KB |
Output is correct |
8 |
Correct |
29 ms |
1292 KB |
Output is correct |
9 |
Correct |
24 ms |
1344 KB |
Output is correct |
10 |
Correct |
24 ms |
1340 KB |
Output is correct |
11 |
Correct |
39 ms |
1324 KB |
Output is correct |
12 |
Correct |
41 ms |
1312 KB |
Output is correct |
13 |
Correct |
25 ms |
1392 KB |
Output is correct |
14 |
Correct |
26 ms |
1356 KB |
Output is correct |
15 |
Correct |
40 ms |
1356 KB |
Output is correct |
16 |
Correct |
26 ms |
1312 KB |
Output is correct |
17 |
Correct |
41 ms |
1288 KB |
Output is correct |
18 |
Correct |
43 ms |
1352 KB |
Output is correct |
19 |
Correct |
25 ms |
1364 KB |
Output is correct |
20 |
Correct |
25 ms |
1292 KB |
Output is correct |
21 |
Correct |
25 ms |
1340 KB |
Output is correct |
22 |
Correct |
51 ms |
1204 KB |
Output is correct |
23 |
Correct |
25 ms |
1204 KB |
Output is correct |
24 |
Correct |
49 ms |
1316 KB |
Output is correct |
25 |
Correct |
25 ms |
1340 KB |
Output is correct |
26 |
Correct |
27 ms |
1312 KB |
Output is correct |
27 |
Correct |
28 ms |
1376 KB |
Output is correct |
28 |
Correct |
42 ms |
1556 KB |
Output is correct |
29 |
Correct |
43 ms |
1288 KB |
Output is correct |
30 |
Correct |
28 ms |
1376 KB |
Output is correct |
31 |
Correct |
29 ms |
1576 KB |
Output is correct |
32 |
Correct |
29 ms |
1348 KB |
Output is correct |
33 |
Correct |
29 ms |
1384 KB |
Output is correct |
34 |
Correct |
23 ms |
1320 KB |
Output is correct |
35 |
Correct |
30 ms |
1312 KB |
Output is correct |
36 |
Correct |
42 ms |
1308 KB |
Output is correct |
37 |
Correct |
46 ms |
1316 KB |
Output is correct |
38 |
Correct |
54 ms |
1312 KB |
Output is correct |
39 |
Correct |
54 ms |
1336 KB |
Output is correct |
40 |
Correct |
29 ms |
1376 KB |
Output is correct |
41 |
Correct |
28 ms |
1288 KB |
Output is correct |
42 |
Correct |
26 ms |
1308 KB |
Output is correct |
43 |
Runtime error |
1 ms |
1368 KB |
Execution killed with signal 6 |
44 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
23 ms |
1352 KB |
Output is correct |
2 |
Correct |
23 ms |
1352 KB |
Output is correct |
3 |
Correct |
48 ms |
1312 KB |
Output is correct |
4 |
Correct |
25 ms |
1288 KB |
Output is correct |
5 |
Correct |
26 ms |
1340 KB |
Output is correct |
6 |
Correct |
28 ms |
1328 KB |
Output is correct |
7 |
Correct |
28 ms |
1312 KB |
Output is correct |
8 |
Correct |
29 ms |
1292 KB |
Output is correct |
9 |
Correct |
24 ms |
1344 KB |
Output is correct |
10 |
Correct |
24 ms |
1340 KB |
Output is correct |
11 |
Correct |
39 ms |
1324 KB |
Output is correct |
12 |
Correct |
41 ms |
1312 KB |
Output is correct |
13 |
Correct |
25 ms |
1392 KB |
Output is correct |
14 |
Correct |
26 ms |
1356 KB |
Output is correct |
15 |
Correct |
40 ms |
1356 KB |
Output is correct |
16 |
Correct |
26 ms |
1312 KB |
Output is correct |
17 |
Correct |
41 ms |
1288 KB |
Output is correct |
18 |
Correct |
43 ms |
1352 KB |
Output is correct |
19 |
Correct |
25 ms |
1364 KB |
Output is correct |
20 |
Correct |
25 ms |
1292 KB |
Output is correct |
21 |
Correct |
25 ms |
1340 KB |
Output is correct |
22 |
Correct |
51 ms |
1204 KB |
Output is correct |
23 |
Correct |
25 ms |
1204 KB |
Output is correct |
24 |
Correct |
49 ms |
1316 KB |
Output is correct |
25 |
Correct |
25 ms |
1340 KB |
Output is correct |
26 |
Correct |
27 ms |
1312 KB |
Output is correct |
27 |
Correct |
28 ms |
1376 KB |
Output is correct |
28 |
Correct |
42 ms |
1556 KB |
Output is correct |
29 |
Correct |
43 ms |
1288 KB |
Output is correct |
30 |
Correct |
28 ms |
1376 KB |
Output is correct |
31 |
Correct |
29 ms |
1576 KB |
Output is correct |
32 |
Correct |
29 ms |
1348 KB |
Output is correct |
33 |
Correct |
29 ms |
1384 KB |
Output is correct |
34 |
Correct |
23 ms |
1320 KB |
Output is correct |
35 |
Correct |
30 ms |
1312 KB |
Output is correct |
36 |
Correct |
42 ms |
1308 KB |
Output is correct |
37 |
Correct |
46 ms |
1316 KB |
Output is correct |
38 |
Correct |
54 ms |
1312 KB |
Output is correct |
39 |
Correct |
54 ms |
1336 KB |
Output is correct |
40 |
Correct |
29 ms |
1376 KB |
Output is correct |
41 |
Correct |
28 ms |
1288 KB |
Output is correct |
42 |
Correct |
26 ms |
1308 KB |
Output is correct |
43 |
Runtime error |
1 ms |
1368 KB |
Execution killed with signal 6 |
44 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
23 ms |
1308 KB |
Output is correct |
2 |
Correct |
38 ms |
1324 KB |
Output is correct |
3 |
Correct |
38 ms |
1316 KB |
Output is correct |
4 |
Correct |
40 ms |
1316 KB |
Output is correct |
5 |
Partially correct |
27 ms |
1380 KB |
Partially correct |
6 |
Partially correct |
45 ms |
1312 KB |
Partially correct |
7 |
Partially correct |
29 ms |
1332 KB |
Partially correct |
8 |
Partially correct |
28 ms |
1336 KB |
Partially correct |
9 |
Runtime error |
2 ms |
1368 KB |
Execution killed with signal 6 |
10 |
Halted |
0 ms |
0 KB |
- |