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.h"
#include<iostream>
using namespace std;
int longest_laugh(std::string s)
{
char anc = ' ';
int longueurMax = 0;
int longeur = 0;
for(char a : s)
{
// cout << longeur << endl;
if(a == 'a')
{
// cout << "bbb";
// cout << anc << endl;
if(anc == 'h')
{
longeur++;
}
else
{
longeur = 1;
}
}
else if(a == 'h')
{
if(anc == 'a')
{
longeur++;
}
else
longeur = 1;
}
else
longeur = 0;
longueurMax = max(longueurMax, longeur);
anc = a;
}
return longueurMax;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |