# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
23990 | gs14004 | Laugh Analysis (IOI16_laugh) | C++11 | 6 ms | 2728 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) {
vector<int> dp(s.size());
for(int i=1; i<dp.size(); i++){
if(s[i-1] == 'a' && s[i] == 'h') dp[i] = dp[i-1] + 1;
else if(s[i-1] == 'h' && s[i] == 'a') dp[i] = dp[i-1] + 1;
}
return *max_element(dp.begin(), dp.end()) + 1;
}
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... |