Submission #69682

#TimeUsernameProblemLanguageResultExecution timeMemory
69682win11905Laugh Analysis (IOI16_laugh)C++11
100 / 100
11 ms2692 KiB
#include "laugh.h" #include <bits/stdc++.h> using namespace std; int mx, cnt; int longest_laugh(string s) { for(int i = 0; i < s.size(); ++i) { if(i != 0) if(s[i] == s[i-1]) cnt = 0; if(s[i] == 'h' || s[i] == 'a') cnt++; else cnt = 0; mx = max(mx, cnt); } return mx; }

Compilation message (stderr)

laugh.cpp: In function 'int longest_laugh(std::__cxx11::string)':
laugh.cpp:8:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int i = 0; i < s.size(); ++i) {
                    ~~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...