답안 #898354

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
898354 2024-01-04T14:17:28 Z devkudawla Laugh Analysis (IOI16_laugh) C++17
컴파일 오류
0 ms 0 KB
// AUTHOR->DEV KUDAWLA
//----------------------------------------------------
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
//----------------------------------------------------
void solve(bool testCases = true)
{
    ll T = 1; //->TEST CASES
    if (testCases)
        cin >> T;
    while (T--)
    {
        string s;
        cin >> s;
        ll n = s.size();
        vector<ll> dp(n, 0);
        if (s[0] == 'h' or s[0] == 'a')
            dp[0] = 1;
        ll answer = 0;
        for (ll i = 1; i < n; i++)
        {
            if (s[i] == 'h' or s[i] == 'a')
            {
                dp[i] = 1;
                if ((s[i] == 'h' and s[i - 1] == 'a') or (s[i] == 'a' and s[i - 1] == 'h'))
                    dp[i] = max(dp[i], dp[i - 1] + dp[i]);
            }
            answer = max(answer, dp[i]);
        }

        cout << answer;

        nline;
    }
    //--------------------------------------------
    //  CODE ENDS HERE
}
//----------------------------------------------------
int main()
{



    return 0;
}
//----------------------------------------------------

Compilation message

laugh.cpp: In function 'void solve(bool)':
laugh.cpp:34:9: error: 'nline' was not declared in this scope
   34 |         nline;
      |         ^~~~~