Submission #832911

#TimeUsernameProblemLanguageResultExecution timeMemory
832911DarkMatterLaugh Analysis (IOI16_laugh)C++14
100 / 100
2 ms596 KiB
#include "laugh.h" #include<bits/stdc++.h> using namespace std; bool check(char c) { return (c == 'h' || c == 'a'); } int longest_laugh(std::string s) { int n = s.size(); int ans = 0, cur = 0; for (int i = 0; i < n; i++) { if (check(s[i])) { if (!i || !check(s[i - 1])) cur = 1; else cur = (s[i] != s[i - 1] ? cur + 1 : 1); } else cur = 0; ans = max(ans, cur); } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...