#include "Anna.h"
#include <bits/stdc++.h>
using namespace std;
namespace {
mt19937 rnd(11);
}
std::pair<std::string, int> anna(int N, std::string S) {
string t;
for (int i = 0; i < N; ++i) {
t += "RGB"[rnd()%3];
if (t.back() == S[i]) {
t.back() = 'R';
if (t.back() == S[i]) {
t.back() = 'B';
}
}
}
return make_pair(t, min(N, 130));
}
#include "Bruno.h"
#include <bits/stdc++.h>
using namespace std;
namespace {
int N;
string s;
mt19937 rnd(11);
} // namespace
void init(int N, int l) {
::N = N;
for (int i = 0; i < N; ++i) {
s += "RGB"[rnd()%3];
}
}
int bruno(std::string u) {
int best = -1, bestcnt = -1;
for (int i = 0; i <= s.size() - u.size(); ++i) {
int cnt = 0;
for (int j = 0; j < u.size(); ++j) {
if (s[i + j] == u[j]) {
++cnt;
}
}
if (cnt > bestcnt) {
best = i;
bestcnt = cnt;
}
}
return best + 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... |