Submission #832894

#TimeUsernameProblemLanguageResultExecution timeMemory
832894DarkMatterLaugh Analysis (IOI16_laugh)C++14
0 / 100
0 ms212 KiB
#include "laugh.h" #include<bits/stdc++.h> using namespace std; int longest_laugh(std::string s) { int n = s.size(); int ans = 0; string cur = ""; for (int i = 0; i < n; i++) { if ((s[i] != 'a' && s[i] != 'h') || (cur.size() && s[i] == cur.back())) { ans = max(ans, (int)cur.size()); cur.clear(); } else cur += s[i]; } 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...