# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
170342 | ngmh | Laugh Analysis (IOI16_laugh) | C++11 | 8 ms | 760 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 best = 0, current = 1;
for(int i = 1; i < s.size(); i++){
if((s[i-1] == 'a' && s[i] == 'h') || (s[i-1] == 'h' && s[i] == 'a')) current++;
else {
best = max(best, current);
current = 1;
}
}
best = max(best, current);
return best;
}
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... |