# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
926389 | rainboy | Laugh Analysis (IOI16_laugh) | C11 | 1 ms | 604 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 "laugh_c.h"
#include <string.h>
int max(int a, int b) { return a > b ? a : b; }
int longest_laugh(char *cc) {
int n, i, j, k;
char c;
n = strlen(cc);
k = 0;
for (i = 0; i < n; i++)
if (cc[i] == 'a' || cc[i] == 'h') {
c = cc[i];
j = i;
while (j < n && cc[j] == c)
j++, c = c == 'a' ? 'h' : 'a';
k = max(k, j - i);
i = j - 1;
}
return k;
}
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... |