# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
162564 | dolphingarlic | Laugh Analysis (IOI16_laugh) | C++14 | 2 ms | 376 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"
int longest_laugh(std::string s) {
int ans = 0, curr = 0;
for (int i = 0; i < s.size(); i++) {
if ((s[i] == 'a' && (i == 0 || s[i - 1] == 'h')) || (s[i] == 'h' && (i == 0 || s[i - 1] == 'a'))) curr++;
else curr = 0;
ans = (ans > curr ? ans : curr);
}
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... |