# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
957157 | ALTAKEXE | Laugh Analysis (IOI16_laugh) | C++14 | 3 ms | 704 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;
bool check(char c)
{
return (c == 'h' || c == 'a');
}
int longest_laugh(string s)
{
int ans = 0, mx = 0;
for (int i = 0; i < s.size(); i++)
{
if (check(s[i]))
{
if (!i || !check(s[i - 1]))
mx = 1;
else
mx = (s[i] != s[i - 1] ? mx + 1 : 1);
}
else
mx = 0;
ans = max(ans, mx);
}
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... |