Submission #832872

#TimeUsernameProblemLanguageResultExecution timeMemory
832872DarkMatterLaugh Analysis (IOI16_laugh)C++14
47 / 100
1069 ms736 KiB
#include "laugh.h" #include<bits/stdc++.h> using namespace std; int longest_laugh(std::string s) { int n = s.size(); int ans = 0; for (int i = 0; i < n; i++) { if (s[i] != 'a' && s[i] != 'h') continue; string cur = ""; for (int j = i; j < n; j++) { if (s[j] != 'a' && s[j] != 'h') break; if (cur.empty() || cur.back() != s[j]) cur += s[j]; else break; } ans = max(ans, (int)cur.size()); } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...