This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |