이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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;
}
컴파일 시 표준 에러 (stderr) 메시지
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 |
---|
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... |