# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1034137 | d4xn | Tricolor Lights (JOI24_tricolor) | C++17 | 0 ms | 0 KiB |
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>
using namespace std;
pair<string, int> anna(int n, string s) {
string t(n, '.');
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';
}
for (int i = 2; i < n; i++) {
t[i] = (s[i] == 'R' ? 'G' : 'R');
}
return make_pair(t, min(130, n));
}
#include "Bruno.h"
#include <bits/stdc++.h>
using namespace std;
int bruno(string u) {
if (u[0] == u[1]) return 1;
else return 2;
}