# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1236593 | Hamed_Ghaffari | Laugh Analysis (IOI16_laugh) | C++20 | 3 ms | 584 KiB |
#include "laugh.h"
#include <bits/stdc++.h>
using namespace std;
int longest_laugh(string s) {
int ans = 0;
for(int l=0,r=0; r<s.size(); r++) {
if(s[r]!='a' && s[r]!='h') l = r+1;
else if(l!=r && s[r]==s[r-1]) l=r;
ans = max(ans, r-l+1);
}
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... |