# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
957155 | ALTAKEXE | Laugh Analysis (IOI16_laugh) | C++14 | 1 ms | 348 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 <bits/stdc++.h>
using namespace std;
int longest_laugh(string s)
{
int ans = 0, mx = 0;
for (int i = 0; i < s.size(); i++)
{
mx = max(ans, mx);
if (s[i] == 'a')
ans++;
if (s[i] == 'h' && s[i - 1] == 'a' || s[i + 1] == 'a')
ans++;
if (s[i] != 'a' && s[i] != 'h')
ans = 0;
}
return mx;
}
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... |