#include "Anna.h"
#include<bits/stdc++.h>
#define ll long long
using namespace std;
char diff(char a,char b){
if(a>b)
swap(a,b);
if(a=='R' and b=='G')
return 'B';
if(a=='R' and b=='B')
return 'G';
return 'R';
}
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');
T[1]=T[N-1]=diff(s[1],s.back());
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){
string S=s;
if(S[0]==S.back())
return 2;
return 1;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
27 ms |
1316 KB |
Output is correct |
2 |
Runtime error |
3 ms |
1624 KB |
Execution killed with signal 6 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
27 ms |
1316 KB |
Output is correct |
2 |
Runtime error |
3 ms |
1624 KB |
Execution killed with signal 6 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
27 ms |
1316 KB |
Output is correct |
2 |
Runtime error |
3 ms |
1624 KB |
Execution killed with signal 6 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
27 ms |
1316 KB |
Output is correct |
2 |
Runtime error |
3 ms |
1624 KB |
Execution killed with signal 6 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
26 ms |
1324 KB |
Output is correct |
2 |
Runtime error |
3 ms |
1624 KB |
Execution killed with signal 6 |
3 |
Halted |
0 ms |
0 KB |
- |