# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
20587 | model_code | Laugh Analysis (IOI16_laugh) | C11 | 0 ms | 1212 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"
static int max(int a, int b) {
return a > b ? a : b;
}
int longest_laugh(char* s)
{
int slen = strlen(s);
int cur = 0, ans = 0;
if (s[0] == 'a' || s[0] == 'h')
cur++;
for (int i = 1; i < slen; i++)
{
if ((s[i - 1] == 'a' && s[i] == 'h') || (s[i - 1] == 'h' && s[i] == 'a'))
cur++;
else
{
ans = max(ans, cur);
cur = 0;
if (s[i] == 'a' || s[i] == 'h')
cur++;
}
}
ans = max(ans, cur);
return ans;
}
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... |