# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
536539 | rainboy | JOIOJI (JOI14_joioji) | C11 | 284 ms | 272 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 <stdio.h>
#define N 4000
int max(int a, int b) { return a > b ? a : b; }
int main() {
static char cc[N + 1];
int n, i, j, kj, ko, ki, l;
scanf("%d%s", &n, cc);
l = 0;
for (i = 0; i < n; i++) {
kj = ko = ki = 0;
for (j = i; j < n; j++) {
if (cc[j] == 'J')
kj++;
else if (cc[j] == 'O')
ko++;
else
ki++;
if (kj == ki && ko == ki)
l = max(l, j - i + 1);
}
}
printf("%d\n", l);
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |