#include "Anna.h"
#include<bits/stdc++.h>
#define ll long long
using namespace std;
char diff(char a,char b){
if(a!='R' and b!='R')
return 'R';
if(a!='G' and b!='G')
return 'G';
if(a!='B' and b!='B')
return 'B';
}
pair<string, int> anna(int n, string s) {
string T;
int N=n;
string S=s;
for(int i=0;i<N;i++)
if(S[i]=='R')
T.push_back('G');
else
T.push_back('R');
if(N<=10)
return {T,N};
T[1]=T[N-1]=diff(s[1],s[N-1]);
T[N-2]=diff(s[N-2],T[0]);
return {T,N-1};
}
#include "Anna.h"
#include<bits/stdc++.h>
#define ll long long
using namespace std;
namespace {
int N,L;
};
void init(int n, int l) {
::N=n;
::L=l;
}
int bruno(string s){
if(::N == ::L)
return 1;
string S=s;
if(S[0]==S.back())
return 2;
return 1;
}
Compilation message
Anna.cpp: In function 'char diff(char, char)':
Anna.cpp:12:1: warning: control reaches end of non-void function [-Wreturn-type]
12 | }
| ^
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
24 ms |
1356 KB |
Output is correct |
2 |
Correct |
38 ms |
1324 KB |
Output is correct |
3 |
Correct |
24 ms |
1288 KB |
Output is correct |
4 |
Correct |
26 ms |
1324 KB |
Output is correct |
5 |
Correct |
28 ms |
1356 KB |
Output is correct |
6 |
Correct |
28 ms |
1288 KB |
Output is correct |
7 |
Correct |
30 ms |
1356 KB |
Output is correct |
8 |
Correct |
44 ms |
1356 KB |
Output is correct |
9 |
Correct |
27 ms |
1332 KB |
Output is correct |
10 |
Correct |
24 ms |
1296 KB |
Output is correct |
11 |
Correct |
39 ms |
1376 KB |
Output is correct |
12 |
Correct |
32 ms |
1296 KB |
Output is correct |
13 |
Correct |
25 ms |
1328 KB |
Output is correct |
14 |
Correct |
35 ms |
1288 KB |
Output is correct |
15 |
Correct |
25 ms |
1332 KB |
Output is correct |
16 |
Correct |
39 ms |
1292 KB |
Output is correct |
17 |
Correct |
25 ms |
1296 KB |
Output is correct |
18 |
Correct |
36 ms |
1316 KB |
Output is correct |
19 |
Correct |
25 ms |
1288 KB |
Output is correct |
20 |
Correct |
28 ms |
1388 KB |
Output is correct |
21 |
Correct |
40 ms |
1288 KB |
Output is correct |
22 |
Correct |
26 ms |
1340 KB |
Output is correct |
23 |
Correct |
28 ms |
1364 KB |
Output is correct |
24 |
Correct |
26 ms |
1388 KB |
Output is correct |
25 |
Correct |
27 ms |
1400 KB |
Output is correct |
26 |
Correct |
42 ms |
1352 KB |
Output is correct |
27 |
Correct |
25 ms |
1292 KB |
Output is correct |
28 |
Correct |
27 ms |
1340 KB |
Output is correct |
29 |
Correct |
37 ms |
1328 KB |
Output is correct |
30 |
Correct |
33 ms |
1328 KB |
Output is correct |
31 |
Correct |
33 ms |
1312 KB |
Output is correct |
32 |
Correct |
31 ms |
1344 KB |
Output is correct |
33 |
Correct |
42 ms |
1312 KB |
Output is correct |
34 |
Correct |
28 ms |
1388 KB |
Output is correct |
35 |
Correct |
44 ms |
1380 KB |
Output is correct |
36 |
Correct |
34 ms |
1312 KB |
Output is correct |
37 |
Correct |
33 ms |
1288 KB |
Output is correct |
38 |
Correct |
34 ms |
1288 KB |
Output is correct |
39 |
Correct |
32 ms |
1236 KB |
Output is correct |
40 |
Correct |
34 ms |
1344 KB |
Output is correct |
41 |
Correct |
33 ms |
1324 KB |
Output is correct |
42 |
Correct |
32 ms |
1312 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
24 ms |
1356 KB |
Output is correct |
2 |
Correct |
38 ms |
1324 KB |
Output is correct |
3 |
Correct |
24 ms |
1288 KB |
Output is correct |
4 |
Correct |
26 ms |
1324 KB |
Output is correct |
5 |
Correct |
28 ms |
1356 KB |
Output is correct |
6 |
Correct |
28 ms |
1288 KB |
Output is correct |
7 |
Correct |
30 ms |
1356 KB |
Output is correct |
8 |
Correct |
44 ms |
1356 KB |
Output is correct |
9 |
Correct |
27 ms |
1332 KB |
Output is correct |
10 |
Correct |
24 ms |
1296 KB |
Output is correct |
11 |
Correct |
39 ms |
1376 KB |
Output is correct |
12 |
Correct |
32 ms |
1296 KB |
Output is correct |
13 |
Correct |
25 ms |
1328 KB |
Output is correct |
14 |
Correct |
35 ms |
1288 KB |
Output is correct |
15 |
Correct |
25 ms |
1332 KB |
Output is correct |
16 |
Correct |
39 ms |
1292 KB |
Output is correct |
17 |
Correct |
25 ms |
1296 KB |
Output is correct |
18 |
Correct |
36 ms |
1316 KB |
Output is correct |
19 |
Correct |
25 ms |
1288 KB |
Output is correct |
20 |
Correct |
28 ms |
1388 KB |
Output is correct |
21 |
Correct |
40 ms |
1288 KB |
Output is correct |
22 |
Correct |
26 ms |
1340 KB |
Output is correct |
23 |
Correct |
28 ms |
1364 KB |
Output is correct |
24 |
Correct |
26 ms |
1388 KB |
Output is correct |
25 |
Correct |
27 ms |
1400 KB |
Output is correct |
26 |
Correct |
42 ms |
1352 KB |
Output is correct |
27 |
Correct |
25 ms |
1292 KB |
Output is correct |
28 |
Correct |
27 ms |
1340 KB |
Output is correct |
29 |
Correct |
37 ms |
1328 KB |
Output is correct |
30 |
Correct |
33 ms |
1328 KB |
Output is correct |
31 |
Correct |
33 ms |
1312 KB |
Output is correct |
32 |
Correct |
31 ms |
1344 KB |
Output is correct |
33 |
Correct |
42 ms |
1312 KB |
Output is correct |
34 |
Correct |
28 ms |
1388 KB |
Output is correct |
35 |
Correct |
44 ms |
1380 KB |
Output is correct |
36 |
Correct |
34 ms |
1312 KB |
Output is correct |
37 |
Correct |
33 ms |
1288 KB |
Output is correct |
38 |
Correct |
34 ms |
1288 KB |
Output is correct |
39 |
Correct |
32 ms |
1236 KB |
Output is correct |
40 |
Correct |
34 ms |
1344 KB |
Output is correct |
41 |
Correct |
33 ms |
1324 KB |
Output is correct |
42 |
Correct |
32 ms |
1312 KB |
Output is correct |
43 |
Incorrect |
1 ms |
856 KB |
Wrong Answer [4] |
44 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
24 ms |
1356 KB |
Output is correct |
2 |
Correct |
38 ms |
1324 KB |
Output is correct |
3 |
Correct |
24 ms |
1288 KB |
Output is correct |
4 |
Correct |
26 ms |
1324 KB |
Output is correct |
5 |
Correct |
28 ms |
1356 KB |
Output is correct |
6 |
Correct |
28 ms |
1288 KB |
Output is correct |
7 |
Correct |
30 ms |
1356 KB |
Output is correct |
8 |
Correct |
44 ms |
1356 KB |
Output is correct |
9 |
Correct |
27 ms |
1332 KB |
Output is correct |
10 |
Correct |
24 ms |
1296 KB |
Output is correct |
11 |
Correct |
39 ms |
1376 KB |
Output is correct |
12 |
Correct |
32 ms |
1296 KB |
Output is correct |
13 |
Correct |
25 ms |
1328 KB |
Output is correct |
14 |
Correct |
35 ms |
1288 KB |
Output is correct |
15 |
Correct |
25 ms |
1332 KB |
Output is correct |
16 |
Correct |
39 ms |
1292 KB |
Output is correct |
17 |
Correct |
25 ms |
1296 KB |
Output is correct |
18 |
Correct |
36 ms |
1316 KB |
Output is correct |
19 |
Correct |
25 ms |
1288 KB |
Output is correct |
20 |
Correct |
28 ms |
1388 KB |
Output is correct |
21 |
Correct |
40 ms |
1288 KB |
Output is correct |
22 |
Correct |
26 ms |
1340 KB |
Output is correct |
23 |
Correct |
28 ms |
1364 KB |
Output is correct |
24 |
Correct |
26 ms |
1388 KB |
Output is correct |
25 |
Correct |
27 ms |
1400 KB |
Output is correct |
26 |
Correct |
42 ms |
1352 KB |
Output is correct |
27 |
Correct |
25 ms |
1292 KB |
Output is correct |
28 |
Correct |
27 ms |
1340 KB |
Output is correct |
29 |
Correct |
37 ms |
1328 KB |
Output is correct |
30 |
Correct |
33 ms |
1328 KB |
Output is correct |
31 |
Correct |
33 ms |
1312 KB |
Output is correct |
32 |
Correct |
31 ms |
1344 KB |
Output is correct |
33 |
Correct |
42 ms |
1312 KB |
Output is correct |
34 |
Correct |
28 ms |
1388 KB |
Output is correct |
35 |
Correct |
44 ms |
1380 KB |
Output is correct |
36 |
Correct |
34 ms |
1312 KB |
Output is correct |
37 |
Correct |
33 ms |
1288 KB |
Output is correct |
38 |
Correct |
34 ms |
1288 KB |
Output is correct |
39 |
Correct |
32 ms |
1236 KB |
Output is correct |
40 |
Correct |
34 ms |
1344 KB |
Output is correct |
41 |
Correct |
33 ms |
1324 KB |
Output is correct |
42 |
Correct |
32 ms |
1312 KB |
Output is correct |
43 |
Incorrect |
1 ms |
856 KB |
Wrong Answer [4] |
44 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
24 ms |
1356 KB |
Output is correct |
2 |
Correct |
38 ms |
1324 KB |
Output is correct |
3 |
Correct |
24 ms |
1288 KB |
Output is correct |
4 |
Correct |
26 ms |
1324 KB |
Output is correct |
5 |
Correct |
28 ms |
1356 KB |
Output is correct |
6 |
Correct |
28 ms |
1288 KB |
Output is correct |
7 |
Correct |
30 ms |
1356 KB |
Output is correct |
8 |
Correct |
44 ms |
1356 KB |
Output is correct |
9 |
Correct |
27 ms |
1332 KB |
Output is correct |
10 |
Correct |
24 ms |
1296 KB |
Output is correct |
11 |
Correct |
39 ms |
1376 KB |
Output is correct |
12 |
Correct |
32 ms |
1296 KB |
Output is correct |
13 |
Correct |
25 ms |
1328 KB |
Output is correct |
14 |
Correct |
35 ms |
1288 KB |
Output is correct |
15 |
Correct |
25 ms |
1332 KB |
Output is correct |
16 |
Correct |
39 ms |
1292 KB |
Output is correct |
17 |
Correct |
25 ms |
1296 KB |
Output is correct |
18 |
Correct |
36 ms |
1316 KB |
Output is correct |
19 |
Correct |
25 ms |
1288 KB |
Output is correct |
20 |
Correct |
28 ms |
1388 KB |
Output is correct |
21 |
Correct |
40 ms |
1288 KB |
Output is correct |
22 |
Correct |
26 ms |
1340 KB |
Output is correct |
23 |
Correct |
28 ms |
1364 KB |
Output is correct |
24 |
Correct |
26 ms |
1388 KB |
Output is correct |
25 |
Correct |
27 ms |
1400 KB |
Output is correct |
26 |
Correct |
42 ms |
1352 KB |
Output is correct |
27 |
Correct |
25 ms |
1292 KB |
Output is correct |
28 |
Correct |
27 ms |
1340 KB |
Output is correct |
29 |
Correct |
37 ms |
1328 KB |
Output is correct |
30 |
Correct |
33 ms |
1328 KB |
Output is correct |
31 |
Correct |
33 ms |
1312 KB |
Output is correct |
32 |
Correct |
31 ms |
1344 KB |
Output is correct |
33 |
Correct |
42 ms |
1312 KB |
Output is correct |
34 |
Correct |
28 ms |
1388 KB |
Output is correct |
35 |
Correct |
44 ms |
1380 KB |
Output is correct |
36 |
Correct |
34 ms |
1312 KB |
Output is correct |
37 |
Correct |
33 ms |
1288 KB |
Output is correct |
38 |
Correct |
34 ms |
1288 KB |
Output is correct |
39 |
Correct |
32 ms |
1236 KB |
Output is correct |
40 |
Correct |
34 ms |
1344 KB |
Output is correct |
41 |
Correct |
33 ms |
1324 KB |
Output is correct |
42 |
Correct |
32 ms |
1312 KB |
Output is correct |
43 |
Incorrect |
1 ms |
856 KB |
Wrong Answer [4] |
44 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
28 ms |
1540 KB |
Output is correct |
2 |
Correct |
26 ms |
1356 KB |
Output is correct |
3 |
Correct |
26 ms |
1612 KB |
Output is correct |
4 |
Correct |
24 ms |
1368 KB |
Output is correct |
5 |
Partially correct |
33 ms |
1320 KB |
Partially correct |
6 |
Partially correct |
40 ms |
1320 KB |
Partially correct |
7 |
Partially correct |
30 ms |
1292 KB |
Partially correct |
8 |
Partially correct |
39 ms |
1328 KB |
Partially correct |
9 |
Incorrect |
1 ms |
856 KB |
Wrong Answer [4] |
10 |
Halted |
0 ms |
0 KB |
- |