이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "Anna.h"
#include <bits/stdc++.h>
using namespace std;
pair<string, int> anna(int n, string s) {
string t(131, '.');
if (s[0] == 'R') {
if (s[1] == 'R') t[0] = t[1] = 'G';
else if (s[1] == 'G') t[0] = t[1] = 'B';
else t[0] = t[1] = 'G';
}
else if (s[0] == 'G') {
if (s[1] == 'R') t[0] = t[1] = 'B';
else if (s[1] == 'G') t[0] = t[1] = 'R';
else t[0] = t[1] = 'R';
}
else {
if (s[1] == 'R') t[0] = t[1] = 'G';
else if (s[1] == 'G') t[0] = t[1] = 'R';
else t[0] = t[1] = 'R';
}
if (t[1] == 'R') {
if (s[2] == 'R') t[2] = 'G';
else if (s[2] == 'G') t[2] = 'B';
else t[2] = 'G';
}
else if (t[1] == 'G') {
if (s[2] == 'R') t[2] = 'B';
else if (s[2] == 'G') t[2] = 'R';
else t[2] = 'R';
}
else {
if (s[2] == 'R') t[2] = 'G';
else if (s[2] == 'G') t[2] = 'R';
else t[2] = 'R';
}
for (int i = 3; i < n; i++) {
t[i] = (s[i] == 'R' ? 'G' : 'R');
}
string tt(n, '.');
for (int i = 0; i < n; i++) {
tt[i] = t[i];
}
return make_pair(tt, min(130, n));
}
#include "Bruno.h"
#include <bits/stdc++.h>
using namespace std;
int n, l;
void init(int N, int L) {
n = N;
l = L;
}
int bruno(string u) {
if (n == 1) return 1;
if (u[0] == u[1]) return 1;
else return 2;
}
# | 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... |