이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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');
if(N<=10)
return {T,N};
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){
if(::N == ::L)
return 1;
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... |