# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
411986 | nxteru | Laugh Analysis (IOI16_laugh) | C++14 | 4 ms | 680 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.h"
#include <bits/stdc++.h>
using namespace std;
int longest_laugh(string s)
{
int ans=0,la=-1,l=0;
for(int i=0;i<s.size();i++){
if(s[i]=='a'){
if(la==1)l++;
else l=1;
la=0;
}else if(s[i]=='h'){
if(la==0)l++;
else l=1;
la=1;
}else{
la=-1;
l=0;
}
ans=max(ans,l);
}
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... |