Submission #956578

#TimeUsernameProblemLanguageResultExecution timeMemory
956578DeltaStructLaugh Analysis (IOI16_laugh)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "laugh.h" using namespace std; int longest_laugh(string s){ int r = 0; for (int i(0),k(1);i < n;++i){ k = (s[i]=='a'||s[i]=='h'?k+1:0); r = max(r,k); } return r; }

Compilation message (stderr)

laugh.cpp: In function 'int longest_laugh(std::string)':
laugh.cpp:7:26: error: 'n' was not declared in this scope
    7 |   for (int i(0),k(1);i < n;++i){
      |                          ^