# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1276084 | cjspd_oly | Laugh Analysis (IOI16_laugh) | C++17 | 0 ms | 332 KiB |
#include "laugh.h"
int longest_laugh(std::string s)
{
int n = s.length();
int ans = 0;
for (int i = 0; i < n; ++i)
{
int j = i;
while (j + 1 < n && s[j + 1] != s[i] && (s[j + 1] == 'a' or s[j + 1] == 'h'))
++j;
ans = std::max(ans, j - i + 1);
i = j;
}
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... |