| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1104293 | overwatch9 | Laugh Analysis (IOI16_laugh) | C++17 | 1 ms | 336 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 <bits/stdc++.h>
using namespace std;
int longest_laugh(string s) {
int ans = 0;
int x = 0;
for (int i = 0; i < (int)s.size(); i++) {
if (s[i] == 'h') {
if ((i-1 <= 0) || (i-1 >= 0 && s[i-1] == 'a')) {
x++;
} else
x = 1;
} else if (s[i] == 'a') {
if ((i-1 <= 0) || (i-1 >= 0 && s[i-1] == 'h')) {
x++;
} else
x = 2;
} else {
x = 0;
}
ans = max(ans, x);
}
return ans;
}| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
